* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
html, body { width: 100%; min-height: 100vh; font-family: 'Vazirmatn', sans-serif; }
body { display: flex; justify-content: center; align-items: flex-start; transition: background 0.4s, color 0.4s; padding-bottom: 80px; }

/* ===== تم شب ===== */
body.dark { background: #05080f; color: #eef2f8; }
body.dark .app-wrapper { background: radial-gradient(ellipse at 20% 30%, #0a0f1a, #05080f); }
body.dark .header { background: rgba(5, 8, 15, 0.85); border-bottom: 1px solid rgba(255,255,255,0.06); }
body.dark .header-title { color: #e8eff7; }
body.dark .header-date { color: #8899b3; }
body.dark .theme-toggle { background: rgba(0,114,255,0.08); border-color: rgba(0,114,255,0.12); color: rgba(0,114,255,0.8); }
body.dark .theme-toggle:hover { background: rgba(0,114,255,0.18); color: #4da3ff; }
body.dark .glow-1 { background: rgba(0,114,255,0.06); }
body.dark .glow-2 { background: rgba(0,114,255,0.04); }
body.dark .bottom-nav { background: rgba(8,12,20,0.96); border-top: 1px solid rgba(255,255,255,0.06); }
body.dark .nav-btn { color: #8899b3; }
body.dark .nav-btn.active { color: #4da3ff; }
body.dark .nav-btn.active .nav-indicator { background: #4da3ff; }
body.dark .board-section { background: linear-gradient(135deg, rgba(0,114,255,0.08), rgba(0,80,200,0.04)); border: 1px solid rgba(0,114,255,0.15); box-shadow: 0 0 40px rgba(0,114,255,0.1); }
body.dark .board-title { color: #e8eff7; }
body.dark .board-label { color: #8899b3; }
body.dark .board-input { background: rgba(0,0,0,0.25); border: 1px solid rgba(0,114,255,0.15); color: #eef2f8; }
body.dark .board-input:focus { border-color: rgba(0,114,255,0.5); }
body.dark .card { background: rgba(255,255,255,0.015); border: 1px solid rgba(255,255,255,0.03); }
body.dark .section-header h2 { color: #e8eff7; }
body.dark .section-header .icon { background: rgba(0,114,255,0.08); color: rgba(0,114,255,0.9); border: 1px solid rgba(0,114,255,0.08); }
body.dark .section-header .line { background: linear-gradient(to left, rgba(0,115,255,0.8), transparent); }
body.dark .cal-day { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.03); }
body.dark .cal-day:hover { border-color: rgba(0,114,255,0.2); background: rgba(0,114,255,0.05); }
body.dark .cal-day.today { border-color: rgba(0,114,255,0.6); background: rgba(0,114,255,0.1); }
body.dark .cal-day.selected { border-color: rgba(0,114,255,0.9); background: rgba(0,114,255,0.15); box-shadow: 0 0 20px rgba(0,114,255,0.3); }
body.dark .cal-day .day-num { color: #d0ddf0; }
body.dark .cal-header { color: #8899b3; }
body.dark .cal-nav-btn { background: rgba(0,114,255,0.08); color: rgba(0,114,255,0.9); }
body.dark .cal-title { color: #e8eff7; }
body.dark .day-detail { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); }
body.dark .day-detail .dd-title { color: #e8eff7; }
body.dark .day-detail .dd-item { background: rgba(0,114,255,0.06); color: #d0ddf0; }
body.dark .day-detail .dd-note { background: rgba(0,114,255,0.04); border-color: rgba(0,114,255,0.15); color: #d0ddf0; }
body.dark .day-detail .dd-empty { color: #556a84; }
body.dark input, body.dark textarea, body.dark select { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); color: #eef2f8; }
body.dark input:focus, body.dark textarea:focus { border-color: rgba(0,114,255,0.35); background: rgba(0,114,255,0.03); }
body.dark input::placeholder, body.dark textarea::placeholder { color: #556a84; }
body.dark .btn-primary { background: linear-gradient(135deg, rgba(0,114,255,0.85), rgba(0,80,200,0.95)); color: #fff; }
body.dark .stat-box { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.03); }
body.dark .stat-box .num { color: rgba(0,114,255,0.95); }
body.dark .stat-box .label { color: #556a84; }
body.dark .stat-box.green .num { color: #22c55e; }
body.dark .stat-box.orange .num { color: #fbbf24; }
body.dark .task-item { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.03); }
body.dark .task-item:hover { border-color: rgba(0,114,255,0.15); background: rgba(255,255,255,0.03); }
body.dark .task-item.done { background: rgba(34,197,94,0.05); border-color: rgba(34,197,94,0.2); }
body.dark .checkbox { border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.02); }
body.dark .checkbox.checked { background: #22c55e; border-color: #22c55e; box-shadow: 0 0 15px rgba(34,197,94,0.6); }
body.dark .task-text { color: #d0ddf0; }
body.dark .task-item.done .task-text { color: #556a84; }
body.dark .task-time { background: rgba(0,114,255,0.08); color: rgba(0,114,255,0.9); }
body.dark .task-date { color: #8899b3; }
body.dark .task-date.overdue { color: #ff5252; background: rgba(255,82,82,0.1); }
body.dark .task-date.today { color: #22c55e; background: rgba(34,197,94,0.1); }
body.dark .btn-icon { color: #8899b3; }
body.dark .btn-icon:hover { background: rgba(0,114,255,0.08); color: rgba(0,114,255,0.9); }
body.dark .btn-icon.danger { color: #ff5252; }
body.dark .btn-icon.danger:hover { background: rgba(255,82,82,0.08); }
body.dark .empty-state { color: #556a84; }
body.dark .filter-tabs { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); }
body.dark .filter-tab-btn { color: #8899b3; }
body.dark .filter-tab-btn.active { background: rgba(0,114,255,0.15); color: #4da3ff; }
body.dark .chart-tabs { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); }
body.dark .chart-tab-btn { color: #8899b3; }
body.dark .chart-tab-btn.active { background: rgba(0,114,255,0.15); color: #4da3ff; }
body.dark .chart-wrapper { background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.03); }
body.dark .chart-y-axis { background: rgba(5,8,15,0.98); border-left: 1px solid rgba(255,255,255,0.06); }
body.dark .chart-scroll::-webkit-scrollbar-thumb { background: rgba(0,114,255,0.3); }
body.dark .chart-legend { color: #8899b3; }
body.dark .study-stat { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.03); }
body.dark .study-stat .ss-num { color: #4da3ff; }
body.dark .study-stat .ss-label { color: #556a84; }
body.dark .hours-history-item { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.03); }
body.dark .hours-history-item .hh-date { color: #8899b3; }
body.dark .history-empty { color: #556a84; }
body.dark .today-label { background: rgba(0,114,255,0.1); color: #4da3ff; }
body.dark .note-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); }
body.dark .note-card:hover { border-color: rgba(0,114,255,0.15); background: rgba(255,255,255,0.03); }
body.dark .note-card .note-text { color: #d0ddf0; }
body.dark .note-card .note-date { color: #556a84; }
body.dark .note-card.pinned { border-color: rgba(251,191,36,0.2); background: rgba(251,191,36,0.03); }
body.dark .tab-container { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); }
body.dark .tab-btn { color: #8899b3; }
body.dark .tab-btn.active { background: rgba(0,114,255,0.15); color: #4da3ff; }
body.dark .notebook-wrapper { background: linear-gradient(180deg, #0f1420 0%, #0a0f1a 100%); border: 1px solid rgba(0,114,255,0.15); box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 0 60px rgba(0,114,255,0.03); }
body.dark .notebook-page { background: #0d121c; }
body.dark .notebook-page::before { background-image: repeating-linear-gradient(to bottom, transparent 0px, transparent 31px, rgba(0, 168, 255, 0.18) 31px, rgba(0, 168, 255, 0.18) 32px); }
body.dark .notebook-textarea { color: #d0ddf0; caret-color: #4da3ff; }
body.dark .notebook-textarea::placeholder { color: #3a4a5f; }
body.dark .notebook-header { background: linear-gradient(135deg, rgba(0,114,255,0.12), rgba(0,80,200,0.08)); border-bottom: 1px solid rgba(0,114,255,0.15); }
body.dark .notebook-title { color: #4da3ff; }
body.dark .notebook-date-info { color: #8899b3; }
body.dark .notebook-nav-btn { background: rgba(0,114,255,0.1); color: #4da3ff; border: 1px solid rgba(0,114,255,0.15); }
body.dark .notebook-nav-btn:hover:not(:disabled) { background: rgba(0,114,255,0.2); }
body.dark .notebook-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
body.dark .notebook-page-num { background: rgba(0,114,255,0.1); color: #4da3ff; border: 1px solid rgba(0,114,255,0.2); }
body.dark .notebook-footer { background: rgba(0,0,0,0.3); border-top: 1px solid rgba(255,255,255,0.05); }
body.dark .notebook-info { color: #8899b3; }
body.dark .notebook-jump-input { background: rgba(0,0,0,0.3); border: 1px solid rgba(0,114,255,0.2); color: #eef2f8; }
body.dark .timer-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); }
body.dark .timer-card.active { border-color: rgba(0,114,255,0.4); background: rgba(0,114,255,0.06); box-shadow: 0 0 30px rgba(0,114,255,0.15); }
body.dark .timer-card .tc-title { color: #d0ddf0; }
body.dark .timer-card .tc-date { color: #556a84; }
body.dark .ring-bg { stroke: rgba(255,255,255,0.06); }
body.dark .timer-status { color: #8899b3; }
body.dark .timer-btn { background: rgba(0,114,255,0.12); color: #4da3ff; }
body.dark .timer-btn.danger { background: rgba(255,82,82,0.12); color: #ff5252; }
body.dark .sleep-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); }
body.dark .sleep-duration-display { background: rgba(168,85,247,0.08); border: 1px solid rgba(168,85,247,0.15); }
body.dark .sleep-duration-display .sdd-text { color: #a855f7; }
body.dark .sleep-stat { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.03); }
body.dark .sleep-stat .ss-num { color: #a855f7; }
body.dark .sleep-stat .ss-label { color: #556a84; }
body.dark .sleep-history-item { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.03); }
body.dark .sleep-history-item .sh-date { color: #8899b3; }
body.dark .sleep-history-item .sh-times { color: #8899b3; }
body.dark .sleep-history-item .sh-duration { color: #a855f7; }
body.dark .sleep-history-item .sh-del { color: #ff5252; }
body.dark .sleep-history-item .sh-del:hover { background: rgba(255,82,82,0.1); }
body.dark .modal-content { background: #0a0f1a; border: 1px solid rgba(0,114,255,0.15); color: #eef2f8; }
body.dark .modal-title { color: #e8eff7; }
body.dark .modal-date { color: #556a84; }
body.dark .modal-full-text { color: #d0ddf0; }
body.dark .modal-close { background: rgba(255,82,82,0.1); color: #ff5252; }
body.dark .edit-textarea { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); color: #eef2f8; }
body.dark .sleep-big-toast { background: linear-gradient(135deg, #1a1f2e, #0f1420); border: 2px solid rgba(168,85,247,0.4); box-shadow: 0 20px 60px rgba(168,85,247,0.3), 0 0 60px rgba(168,85,247,0.15); }
body.dark .sbt-title { color: #a855f7; }
body.dark .sbt-body { color: #8899b3; }
body.dark .holiday-name { background: rgba(10,15,26,0.95); color: #ff6b6b; }
body.dark .sleep-loader-label { color: #8899b3; }
body.dark .sleep-loader-ring .slr-bg { stroke: rgba(255,255,255,0.06); }
body.dark .sleep-loader-ring .slr-time { color: #e8eff7; }
body.dark .alarm-btn .ab-label { color: #8899b3; }
body.dark .time-input-label { color: #8899b3; }
body.dark .time-hint { color: #8899b3; }
body.dark .timer-subtabs { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); }
body.dark .timer-subtab-btn { color: #8899b3; }
body.dark .timer-subtab-btn.active { background: rgba(0,114,255,0.15); color: #4da3ff; }
body.dark .stopwatch-main { background: linear-gradient(135deg, rgba(0,114,255,0.05), rgba(0,80,200,0.02)); border: 1px solid rgba(0,114,255,0.1); }
body.dark .stopwatch-ms { color: #8899b3; }
body.dark .stopwatch-lap-item { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); }
body.dark .stopwatch-lap-item .lap-num { color: #8899b3; }

/* ===== تم روز ===== */
body.light { background: #f0f4fe; color: #0a1428; }
body.light .app-wrapper { background: radial-gradient(ellipse at 20% 30%, #ffffff, #f5f9ff); }
body.light .header { background: rgba(255, 255, 255, 0.85); border-bottom: 1px solid rgba(0,114,255,0.08); }
body.light .header-title { color: #0a1428; }
body.light .header-date { color: #5a6a82; }
body.light .theme-toggle { background: rgba(0,114,255,0.06); border-color: rgba(0,114,255,0.1); color: rgba(0,114,255,0.75); }
body.light .theme-toggle:hover { background: rgba(0,114,255,0.14); color: #0072ff; }
body.light .glow-1 { background: rgba(0,114,255,0.04); }
body.light .glow-2 { background: rgba(0,114,255,0.03); }
body.light .bottom-nav { background: rgba(255,255,255,0.98); border-top: 1px solid rgba(0,114,255,0.1); }
body.light .nav-btn { color: #8a9ab2; }
body.light .nav-btn.active { color: #0072ff; }
body.light .nav-btn.active .nav-indicator { background: #0072ff; }
body.light .board-section { background: linear-gradient(135deg, rgba(0,114,255,0.06), rgba(0,80,200,0.03)); border: 1px solid rgba(0,114,255,0.12); box-shadow: 0 0 40px rgba(0,114,255,0.06); }
body.light .board-title { color: #0a1428; }
body.light .board-label { color: #4a5a72; }
body.light .board-input { background: rgba(255,255,255,0.85); border: 1px solid rgba(0,114,255,0.15); color: #0a1428; }
body.light .board-input:focus { border-color: rgba(0,114,255,0.5); background: #fff; }
body.light .card { background: rgba(255,255,255,0.55); border: 1px solid rgba(0,114,255,0.05); }
body.light .section-header h2 { color: #0a1428; }
body.light .section-header .icon { background: rgba(0,114,255,0.06); color: rgba(0,114,255,0.85); border: 1px solid rgba(0,114,255,0.08); }
body.light .section-header .line { background: linear-gradient(to left, rgba(0,115,255,0.8), transparent); }
body.light .cal-day { background: rgba(255,255,255,0.6); border: 1px solid rgba(0,114,255,0.05); }
body.light .cal-day:hover { border-color: rgba(0,114,255,0.2); background: rgba(0,114,255,0.04); }
body.light .cal-day.today { border-color: rgba(0,114,255,0.6); background: rgba(0,114,255,0.08); }
body.light .cal-day.selected { border-color: rgba(0,114,255,0.9); background: rgba(0,114,255,0.12); box-shadow: 0 0 20px rgba(0,114,255,0.25); }
body.light .cal-day .day-num { color: #0a1428; }
body.light .cal-header { color: #5a6a82; }
body.light .cal-nav-btn { background: rgba(0,114,255,0.06); color: rgba(0,114,255,0.85); }
body.light .cal-title { color: #0a1428; }
body.light .day-detail { background: rgba(255,255,255,0.6); border: 1px solid rgba(0,114,255,0.05); }
body.light .day-detail .dd-title { color: #0a1428; }
body.light .day-detail .dd-item { background: rgba(0,114,255,0.06); color: #0a1428; }
body.light .day-detail .dd-note { background: rgba(0,114,255,0.04); border-color: rgba(0,114,255,0.15); color: #0a1428; }
body.light .day-detail .dd-empty { color: #8a9ab2; }
body.light input, body.light textarea, body.light select { background: rgba(255,255,255,0.75); border: 1px solid rgba(0,114,255,0.08); color: #0a1428; }
body.light input:focus, body.light textarea:focus { border-color: rgba(0,114,255,0.35); background: #fff; }
body.light input::placeholder, body.light textarea::placeholder { color: #8a9ab2; }
body.light .btn-primary { background: linear-gradient(135deg, rgba(0,114,255,0.9), rgba(0,80,200,1)); color: #fff; }
body.light .stat-box { background: rgba(255,255,255,0.55); border: 1px solid rgba(0,114,255,0.05); }
body.light .stat-box .num { color: rgba(0,114,255,0.85); }
body.light .stat-box .label { color: #5a6a82; }
body.light .stat-box.green .num { color: #16a34a; }
body.light .stat-box.orange .num { color: #d97706; }
body.light .task-item { background: rgba(255,255,255,0.55); border: 1px solid rgba(0,114,255,0.05); }
body.light .task-item:hover { border-color: rgba(0,114,255,0.15); background: rgba(255,255,255,0.85); }
body.light .task-item.done { background: rgba(34,197,94,0.06); border-color: rgba(34,197,94,0.25); }
body.light .checkbox { border-color: rgba(0,114,255,0.25); background: #fff; }
body.light .checkbox.checked { background: #22c55e; border-color: #22c55e; box-shadow: 0 0 15px rgba(34,197,94,0.5); }
body.light .task-text { color: #0a1428; }
body.light .task-item.done .task-text { color: #8a9ab2; }
body.light .task-time { background: rgba(0,114,255,0.08); color: rgba(0,114,255,0.8); }
body.light .task-date { color: #5a6a82; }
body.light .task-date.overdue { color: #ff5252; background: rgba(255,82,82,0.08); }
body.light .task-date.today { color: #16a34a; background: rgba(34,197,94,0.08); }
body.light .btn-icon { color: #8a9ab2; }
body.light .btn-icon:hover { background: rgba(0,114,255,0.06); color: rgba(0,114,255,0.85); }
body.light .btn-icon.danger { color: #ff5252; }
body.light .btn-icon.danger:hover { background: rgba(255,82,82,0.06); }
body.light .empty-state { color: #8a9ab2; }
body.light .filter-tabs { background: rgba(255,255,255,0.6); border: 1px solid rgba(0,114,255,0.06); }
body.light .filter-tab-btn { color: #8a9ab2; }
body.light .filter-tab-btn.active { background: rgba(0,114,255,0.1); color: #0072ff; }
body.light .chart-tabs { background: rgba(255,255,255,0.6); border: 1px solid rgba(0,114,255,0.06); }
body.light .chart-tab-btn { color: #8a9ab2; }
body.light .chart-tab-btn.active { background: rgba(0,114,255,0.1); color: #0072ff; }
body.light .chart-wrapper { background: rgba(255,255,255,0.7); border: 1px solid rgba(0,114,255,0.05); }
body.light .chart-y-axis { background: rgba(255,255,255,0.98); border-left: 1px solid rgba(0,114,255,0.08); }
body.light .chart-scroll::-webkit-scrollbar-thumb { background: rgba(0,114,255,0.25); }
body.light .chart-legend { color: #5a6a82; }
body.light .study-stat { background: rgba(255,255,255,0.6); border: 1px solid rgba(0,114,255,0.05); }
body.light .study-stat .ss-num { color: #0072ff; }
body.light .study-stat .ss-label { color: #5a6a82; }
body.light .hours-history-item { background: rgba(255,255,255,0.6); border: 1px solid rgba(0,114,255,0.05); }
body.light .hours-history-item .hh-date { color: #5a6a82; }
body.light .history-empty { color: #8a9ab2; }
body.light .today-label { background: rgba(0,114,255,0.08); color: #0072ff; }
body.light .note-card { background: rgba(255,255,255,0.75); border: 1px solid rgba(0,114,255,0.06); }
body.light .note-card:hover { border-color: rgba(0,114,255,0.18); background: #fff; }
body.light .note-card .note-text { color: #0a1428; }
body.light .note-card .note-date { color: #8a9ab2; }
body.light .note-card.pinned { border-color: rgba(217,119,6,0.25); background: rgba(251,191,36,0.04); }
body.light .tab-container { background: rgba(255,255,255,0.6); border: 1px solid rgba(0,114,255,0.06); }
body.light .tab-btn { color: #8a9ab2; }
body.light .tab-btn.active { background: rgba(0,114,255,0.1); color: #0072ff; }
body.light .notebook-wrapper { background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%); border: 1px solid rgba(0,114,255,0.12); box-shadow: 0 10px 40px rgba(0,80,200,0.08), inset 0 0 60px rgba(0,114,255,0.02); }
body.light .notebook-page { background: #fefeff; }
body.light .notebook-page::before { background-image: repeating-linear-gradient(to bottom, transparent 0px, transparent 31px, rgba(0, 168, 255, 0.35) 31px, rgba(0, 168, 255, 0.35) 32px); }
body.light .notebook-textarea { color: #0a1428; caret-color: #0072ff; }
body.light .notebook-textarea::placeholder { color: #b0c0d4; }
body.light .notebook-header { background: linear-gradient(135deg, rgba(0,114,255,0.08), rgba(0,80,200,0.04)); border-bottom: 1px solid rgba(0,114,255,0.12); }
body.light .notebook-title { color: #0072ff; }
body.light .notebook-date-info { color: #5a6a82; }
body.light .notebook-nav-btn { background: rgba(0,114,255,0.08); color: #0072ff; border: 1px solid rgba(0,114,255,0.12); }
body.light .notebook-nav-btn:hover:not(:disabled) { background: rgba(0,114,255,0.16); }
body.light .notebook-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
body.light .notebook-page-num { background: rgba(0,114,255,0.08); color: #0072ff; border: 1px solid rgba(0,114,255,0.15); }
body.light .notebook-footer { background: rgba(240,244,254,0.6); border-top: 1px solid rgba(0,114,255,0.08); }
body.light .notebook-info { color: #5a6a82; }
body.light .notebook-jump-input { background: rgba(255,255,255,0.9); border: 1px solid rgba(0,114,255,0.15); color: #0a1428; }
body.light .timer-card { background: rgba(255,255,255,0.75); border: 1px solid rgba(0,114,255,0.06); }
body.light .timer-card.active { border-color: rgba(0,114,255,0.4); background: rgba(0,114,255,0.06); }
body.light .timer-card .tc-title { color: #0a1428; }
body.light .timer-card .tc-date { color: #8a9ab2; }
body.light .ring-bg { stroke: rgba(0,114,255,0.08); }
body.light .timer-status { color: #5a6a82; }
body.light .timer-btn { background: rgba(0,114,255,0.1); color: #0072ff; }
body.light .timer-btn.danger { background: rgba(255,82,82,0.1); color: #ff5252; }
body.light .sleep-card { background: rgba(255,255,255,0.7); border: 1px solid rgba(168,85,247,0.1); }
body.light .sleep-duration-display { background: rgba(168,85,247,0.06); border: 1px solid rgba(168,85,247,0.12); }
body.light .sleep-duration-display .sdd-text { color: #a855f7; }
body.light .sleep-stat { background: rgba(255,255,255,0.6); border: 1px solid rgba(168,85,247,0.08); }
body.light .sleep-stat .ss-num { color: #a855f7; }
body.light .sleep-stat .ss-label { color: #5a6a82; }
body.light .sleep-history-item { background: rgba(255,255,255,0.6); border: 1px solid rgba(168,85,247,0.08); }
body.light .sleep-history-item .sh-date { color: #5a6a82; }
body.light .sleep-history-item .sh-times { color: #5a6a82; }
body.light .sleep-history-item .sh-duration { color: #a855f7; }
body.light .sleep-history-item .sh-del { color: #ff5252; }
body.light .sleep-history-item .sh-del:hover { background: rgba(255,82,82,0.08); }
body.light .modal-content { background: #fff; border: 1px solid rgba(0,114,255,0.1); color: #0a1428; }
body.light .modal-title { color: #0a1428; }
body.light .modal-date { color: #8a9ab2; }
body.light .modal-full-text { color: #0a1428; }
body.light .modal-close { background: rgba(255,82,82,0.1); color: #ff5252; }
body.light .edit-textarea { background: rgba(255,255,255,0.75); border: 1px solid rgba(0,114,255,0.08); color: #0a1428; }
body.light .sleep-big-toast { background: linear-gradient(135deg, #ffffff, #f5f9ff); border: 2px solid rgba(168,85,247,0.3); box-shadow: 0 20px 60px rgba(168,85,247,0.2), 0 0 60px rgba(168,85,247,0.08); }
body.light .sbt-title { color: #7e22ce; }
body.light .sbt-body { color: #5a6a82; }
body.light .holiday-name { background: rgba(255,255,255,0.95); color: #dc2626; }
body.light .sleep-loader-label { color: #5a6a82; }
body.light .sleep-loader-ring .slr-bg { stroke: rgba(0,114,255,0.08); }
body.light .sleep-loader-ring .slr-time { color: #0a1428; }
body.light .alarm-btn .ab-label { color: #5a6a82; }
body.light .time-input-label { color: #5a6a82; }
body.light .time-hint { color: #5a6a82; }
body.light .timer-subtabs { background: rgba(255,255,255,0.6); border: 1px solid rgba(0,114,255,0.06); }
body.light .timer-subtab-btn { color: #8a9ab2; }
body.light .timer-subtab-btn.active { background: rgba(0,114,255,0.1); color: #0072ff; }
body.light .stopwatch-main { background: linear-gradient(135deg, rgba(0,114,255,0.05), rgba(0,80,200,0.02)); border: 1px solid rgba(0,114,255,0.1); }
body.light .stopwatch-ms { color: #5a6a82; }
body.light .stopwatch-lap-item { background: rgba(255,255,255,0.6); border: 1px solid rgba(0,114,255,0.06); }
body.light .stopwatch-lap-item .lap-num { color: #5a6a82; }

/* ===== انیمیشن‌ها ===== */
@keyframes floatGlow { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(30px,-30px) scale(1.2); } }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes ringPulse { 0%,100% { filter: drop-shadow(0 0 8px rgba(0,114,255,0.5)); } 50% { filter: drop-shadow(0 0 20px rgba(0,114,255,0.9)); } }
@keyframes sleepPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* ===== ساختار ===== */
.app-wrapper { max-width: 980px; width: 100%; min-height: 100vh; position: relative; margin: 0 auto; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; filter: blur(120px); pointer-events: none; z-index: 0; }
.glow-1 { width: 500px; height: 500px; top: -25%; right: -15%; animation: floatGlow 14s ease-in-out infinite alternate; }
.glow-2 { width: 400px; height: 400px; bottom: -20%; left: -10%; animation: floatGlow 18s ease-in-out infinite alternate-reverse; }

/* ===== هدر ===== */
.header { position: sticky; top: 0; z-index: 100; width: 100%; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transition: background 0.3s, border-color 0.3s; }
.header-inner { max-width: 980px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.85rem 1.5rem; }
.theme-toggle { width: 42px; height: 42px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; transition: all 0.35s cubic-bezier(0.23,1,0.32,1); display: flex; align-items: center; justify-content: center; border: 1px solid; background: transparent; flex-shrink: 0; }
.theme-toggle:hover { transform: scale(1.08) rotate(15deg); }
.header-title { font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: 0.5rem; flex: 1; justify-content: center; }
.header-title .dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #00a8ff, #0072ff); box-shadow: 0 0 10px rgba(0,114,255,0.6); flex-shrink: 0; }
.header-date { font-size: 0.75rem; font-weight: 600; display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; flex-shrink: 0; }

/* ===== محتوا ===== */
.content { position: relative; z-index: 5; padding: 1.5rem 1.5rem 1rem; }
.page { display: none; }
.page.active { display: block; animation: pageIn 0.35s cubic-bezier(0.23,1,0.32,1); }

.section-header { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.9rem; margin-top: 1.5rem; }
.section-header:first-of-type { margin-top: 0; }
.section-header .icon { width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; }
.section-header h2 { font-size: 1.05rem; font-weight: 700; }
.section-header .line { flex: 1; height: 2px; border-radius: 2px; }

.card { border-radius: 18px; padding: 1.2rem; margin-bottom: 1.2rem; transition: all 0.3s; }

/* ===== هدف اصلی ===== */
.board-section { border-radius: 22px; padding: 1.5rem 1.6rem 1.4rem; margin-bottom: 1.5rem; position: relative; overflow: hidden; }
.board-glow { position: absolute; top: -50%; right: -20%; width: 280px; height: 280px; background: rgba(0,114,255,0.18); border-radius: 50%; filter: blur(80px); pointer-events: none; }
.board-header { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1rem; position: relative; }
.board-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; background: linear-gradient(135deg, rgba(0,114,255,0.22), rgba(0,80,200,0.12)); border: 1px solid rgba(0,114,255,0.22); flex-shrink: 0; }
.board-title-wrap { flex: 1; min-width: 0; }
.board-title { font-size: 1rem; font-weight: 800; }
.board-label { font-size: 0.72rem; margin-top: 0.1rem; }
.board-input { width: 100%; padding: 0.95rem 1.1rem; border-radius: 14px; font-size: 1rem; font-weight: 600; font-family: 'Vazirmatn', sans-serif; outline: none; transition: all 0.25s; }

/* ===== تقویم ===== */
.calendar-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 1rem; }
.cal-nav-btn { width: 38px; height: 38px; border-radius: 11px; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; transition: all 0.25s; }
.cal-nav-btn:hover { transform: scale(1.1); }
.cal-title { font-size: 1.05rem; font-weight: 800; text-align: center; flex: 1; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem; margin-bottom: 0.5rem; }
.cal-header { text-align: center; font-size: 0.7rem; font-weight: 700; padding: 0.4rem 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem; }
.cal-day { aspect-ratio: 1; border-radius: 12px; padding: 0.3rem; display: flex; flex-direction: column; align-items: center; justify-content: space-between; cursor: pointer; transition: all 0.25s; position: relative; overflow: hidden; min-height: 58px; }
.cal-day:hover { transform: scale(1.05); }
.cal-day .day-num { font-size: 0.85rem; font-weight: 700; }
.cal-day .pin-icon { position: absolute; top: 3px; left: 4px; font-size: 0.6rem; }
.cal-day .day-badges { display: flex; gap: 0.15rem; flex-wrap: wrap; justify-content: center; }
.cal-day .day-badges .b { font-size: 0.5rem; padding: 0.1rem 0.28rem; border-radius: 4px; font-weight: 700; background: rgba(0,114,255,0.18); color: #0072ff; }
.cal-day .day-badges .b.green { background: rgba(34,197,94,0.18); color: #22c55e; }
.cal-day .day-badges .b.yellow { background: rgba(251,191,36,0.18); color: #fbbf24; }
.cal-day .day-badges .b.purple { background: rgba(168,85,247,0.18); color: #a855f7; }
.cal-day .day-badges .b.orange { background: rgba(251,146,60,0.2); color: #fb923c; }
.cal-day.other-month { opacity: 0.3; pointer-events: none; }
.cal-day.today .day-num { color: rgba(0,114,255,1); }
.cal-day.selected { z-index: 2; }
.cal-day.pinned { border-color: rgba(251,191,36,0.5) !important; }
.cal-day.holiday { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.25); }
.cal-day.holiday:hover { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.4); }
.cal-day.holiday .day-num { color: #ef4444; font-weight: 900; }
.cal-day.holiday.today { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.6); }
.cal-day .holiday-name { position: absolute; top: -2px; left: 2px; right: 2px; font-size: 0.42rem; font-weight: 700; color: #ef4444; text-align: center; line-height: 1.1; border-radius: 3px; padding: 1px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-day.holiday .day-num { margin-top: 8px; }
.day-detail { border-radius: 14px; padding: 1rem; margin-top: 1rem; animation: slideIn 0.35s; }
.day-detail .dd-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.6rem; }
.day-detail .dd-list { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.8rem; }
.day-detail .dd-item { font-size: 0.8rem; padding: 0.5rem 0.7rem; border-radius: 9px; display: flex; align-items: center; gap: 0.45rem; }
.day-detail .dd-empty { font-size: 0.78rem; text-align: center; padding: 1rem; opacity: 0.6; }
.day-detail .dd-section-label { font-size: 0.72rem; font-weight: 700; opacity: 0.7; margin-bottom: 0.4rem; }
.day-detail .dd-note { width: 100%; min-height: 80px; padding: 0.7rem; border-radius: 11px; font-family: 'Vazirmatn', sans-serif; font-size: 0.85rem; line-height: 1.7; resize: vertical; outline: none; transition: all 0.25s; }
.day-detail .dd-actions { display: flex; gap: 0.4rem; margin-top: 0.7rem; flex-wrap: wrap; }
.day-detail .dd-pin-btn { padding: 0.5rem 0.9rem; border-radius: 9px; font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: 'Vazirmatn', sans-serif; border: 1px solid rgba(251,191,36,0.3); background: rgba(251,191,36,0.1); color: #d97706; transition: all 0.25s; }
.day-detail .dd-pin-btn:hover { background: rgba(251,191,36,0.2); }
.day-detail .dd-pin-btn.active { background: rgba(251,191,36,0.25); color: #b45309; }
.day-detail .dd-close-btn { padding: 0.5rem 0.9rem; border-radius: 9px; font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: 'Vazirmatn', sans-serif; border: 1px solid rgba(128,128,128,0.2); background: rgba(128,128,128,0.08); color: #888; transition: all 0.25s; }

/* ===== نمودار ===== */
.chart-tabs { display: flex; gap: 0.3rem; padding: 0.35rem; border-radius: 14px; margin-bottom: 1rem; }
.chart-tab-btn { flex: 1; padding: 0.7rem 0.8rem; border-radius: 11px; border: none; background: transparent; font-family: 'Vazirmatn', sans-serif; font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; gap: 0.4rem; }
.chart-tab-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chart-input-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.chart-input-row input { flex: 1; min-width: 100px; padding: 0.7rem 1rem; border-radius: 11px; font-size: 0.9rem; font-family: 'Vazirmatn', sans-serif; outline: none; text-align: center; transition: all 0.25s; }
.today-label { font-size: 0.78rem; font-weight: 700; padding: 0.5rem 0.9rem; border-radius: 10px; white-space: nowrap; }
.btn-primary { border: none; padding: 0.72rem 1.3rem; border-radius: 11px; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: all 0.35s; white-space: nowrap; font-family: 'Vazirmatn', sans-serif; display: inline-flex; align-items: center; gap: 0.4rem; }
.btn-primary:hover { transform: translateY(-2px); }
.chart-wrapper { display: flex; border-radius: 14px; overflow: hidden; position: relative; height: 300px; }
.chart-y-axis { flex-shrink: 0; width: 48px; height: 300px; position: relative; z-index: 2; }
.chart-y-axis canvas { display: block; width: 48px; height: 300px; }
.chart-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; height: 300px; position: relative; }
.chart-scroll::-webkit-scrollbar { height: 8px; }
.chart-scroll::-webkit-scrollbar-track { background: rgba(128,128,128,0.08); border-radius: 4px; }
.chart-scroll::-webkit-scrollbar-thumb { border-radius: 4px; }
.chart-scroll canvas { display: block; height: 300px; cursor: crosshair; }
.chart-legend { display: flex; justify-content: center; gap: 1.2rem; margin-top: 0.8rem; font-size: 0.72rem; flex-wrap: wrap; }
.chart-legend-item { display: flex; align-items: center; gap: 0.35rem; }
.chart-legend-item .dot { width: 10px; height: 10px; border-radius: 50%; }
.chart-legend-item .dot.blue { background: linear-gradient(135deg, #00a8ff, #0050c8); }
.chart-legend-item .dot.orange { background: linear-gradient(135deg, #fbbf24, #d97706); }
.chart-legend-item .dot.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.chart-legend-item .dot.yellow { background: rgba(251,191,36,0.85); }
.study-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-top: 1rem; }
.study-stat { text-align: center; padding: 0.8rem 0.4rem; border-radius: 13px; transition: all 0.25s; }
.study-stat .ss-num { font-size: 1.15rem; font-weight: 800; }
.study-stat .ss-label { font-size: 0.65rem; margin-top: 0.15rem; }
.hours-history { margin-top: 1rem; max-height: 250px; overflow-y: auto; padding-left: 0.3rem; }
.hours-history::-webkit-scrollbar { width: 5px; }
.hours-history-item { display: flex; align-items: center; justify-content: space-between; padding: 0.65rem 0.9rem; border-radius: 11px; margin-bottom: 0.4rem; font-size: 0.82rem; transition: all 0.25s; }
.hours-history-item:hover { transform: translateX(-2px); }
.hours-history-item .hh-date { display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; flex: 1; }
.hours-history-item .hh-value { font-weight: 800; font-size: 0.85rem; display: flex; align-items: center; gap: 0.3rem; }
.hours-history-item .hh-del { background: none; border: none; color: #ff5252; cursor: pointer; padding: 0.3rem; border-radius: 7px; opacity: 0.7; transition: all 0.25s; margin-right: 0.4rem; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; }
.hours-history-item .hh-del:hover { opacity: 1; background: rgba(255,82,82,0.1); transform: scale(1.1); }
.history-empty { text-align: center; padding: 1.5rem 0.5rem; font-size: 0.8rem; }

#chartTooltip { position: fixed; background: linear-gradient(135deg, #0072ff, #0050c8); color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 12px; font-weight: 600; pointer-events: none; z-index: 10000; opacity: 0; transition: opacity 0.2s; white-space: nowrap; transform: translate(-50%,-130%); box-shadow: 0 6px 20px rgba(0,114,255,0.45); font-family: 'Vazirmatn', sans-serif; }
#chartTooltip.show { opacity: 1; }
#chartTooltip .tt-date { font-size: 10px; opacity: 0.85; margin-bottom: 2px; }
#chartTooltip .tt-value { font-size: 14px; font-weight: 800; }

/* ===== کارها ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-bottom: 0.9rem; }
.form-full { grid-column: 1 / -1; }
.field-group { display: flex; flex-direction: column; gap: 0.4rem; }
.field-label { font-size: 0.72rem; font-weight: 700; display: flex; align-items: center; gap: 0.35rem; opacity: 0.85; }
.field-label .badge-required { font-size: 0.6rem; padding: 0.1rem 0.4rem; border-radius: 6px; background: rgba(255,82,82,0.15); color: #ff5252; font-weight: 800; }
.form-input { width: 100%; padding: 0.75rem 1rem; border-radius: 11px; font-size: 0.9rem; font-family: 'Vazirmatn', sans-serif; outline: none; transition: all 0.25s; }
.form-input.text-input { font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin-bottom: 1.2rem; }
.stat-box { text-align: center; padding: 0.9rem 0.5rem; border-radius: 15px; transition: all 0.25s; }
.stat-box .num { font-size: 1.5rem; font-weight: 800; }
.stat-box .label { font-size: 0.7rem; margin-top: 0.2rem; font-weight: 600; }
.filter-tabs { display: flex; gap: 0.3rem; padding: 0.35rem; border-radius: 14px; margin-bottom: 1rem; }
.filter-tab-btn { flex: 1; padding: 0.6rem 0.3rem; border-radius: 10px; border: none; background: transparent; font-family: 'Vazirmatn', sans-serif; font-size: 0.75rem; font-weight: 700; cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; gap: 0.3rem; }
.filter-tab-btn .count { font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 6px; background: rgba(128,128,128,0.15); }
.tasks-list { display: flex; flex-direction: column; gap: 0.55rem; }
.task-item { display: flex; align-items: flex-start; gap: 0.85rem; padding: 0.9rem 1.1rem; border-radius: 16px; animation: slideIn 0.35s; cursor: pointer; user-select: none; transition: all 0.3s; position: relative; overflow: hidden; }
.task-item:hover { transform: translateX(-3px); }
.task-item .checkbox { width: 24px; height: 24px; min-width: 24px; border-radius: 50%; border: 2.5px solid; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s; flex-shrink: 0; margin-top: 2px; }
.task-item .checkbox:hover { transform: scale(1.15); }
.task-item .checkbox.checked::after { content: '✓'; color: #fff; font-size: 14px; font-weight: 900; line-height: 1; }
.task-content { flex: 1; min-width: 0; }
.task-text { font-size: 0.92rem; word-wrap: break-word; line-height: 1.55; font-weight: 500; }
.task-item.done .task-text { text-decoration: line-through; opacity: 0.7; }
.task-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.task-time, .task-date { font-size: 0.68rem; padding: 0.25rem 0.65rem; border-radius: 20px; display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 700; }
.task-time svg, .task-date svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.task-actions { display: flex; gap: 0.1rem; flex-shrink: 0; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 0.5rem; border-radius: 9px; transition: all 0.25s; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; }
.btn-icon:hover { transform: scale(1.1); }
.btn-icon svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.empty-state { text-align: center; padding: 3rem 1rem; font-size: 0.88rem; }
.empty-state .es-icon { font-size: 3rem; opacity: 0.4; display: block; margin-bottom: 0.8rem; }
.empty-state .es-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; opacity: 0.7; }
.empty-state .es-sub { font-size: 0.78rem; opacity: 0.5; }

/* ===== یادداشت ===== */
.tab-container { display: flex; gap: 0.3rem; padding: 0.35rem; border-radius: 14px; margin-bottom: 1.2rem; }
.tab-btn { flex: 1; padding: 0.75rem 0.8rem; border-radius: 11px; border: none; background: transparent; font-family: 'Vazirmatn', sans-serif; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; gap: 0.45rem; }
.tab-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: pageIn 0.35s; }
.note-form { display: flex; gap: 0.5rem; align-items: flex-end; margin-bottom: 1rem; }
.note-form textarea { flex: 1; min-width: 200px; padding: 0.85rem 1rem; border-radius: 12px; font-size: 0.88rem; font-family: 'Vazirmatn', sans-serif; outline: none; transition: all 0.25s; resize: vertical; min-height: 60px; max-height: 150px; line-height: 1.6; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.8rem; }
.note-card { border-radius: 16px; padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; animation: slideIn 0.35s; min-height: 120px; max-height: 180px; cursor: pointer; overflow: hidden; transition: all 0.3s ease; }
.note-card:hover { transform: translateY(-3px); }
.note-card .note-text-wrap { flex: 1; overflow: hidden; }
.note-card .note-text { font-size: 0.85rem; line-height: 1.65; word-wrap: break-word; white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.note-card .note-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.3rem; padding-top: 0.5rem; border-top: 1px dashed rgba(128,128,128,0.15); }
.note-card .note-date { font-size: 0.65rem; font-weight: 500; display: inline-flex; align-items: center; gap: 0.25rem; }
.note-card .note-actions { display: flex; gap: 0.1rem; }
.note-actions .btn-icon { width: 26px; height: 26px; padding: 0.25rem; }
.note-actions .btn-icon svg { width: 13px; height: 13px; }

.notebook-wrapper { border-radius: 16px; overflow: hidden; transition: all 0.3s; position: relative; }
.notebook-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.9rem 1rem; flex-wrap: wrap; }
.notebook-title { font-size: 0.95rem; font-weight: 800; display: flex; align-items: center; gap: 0.4rem; }
.notebook-date-info { font-size: 0.72rem; font-weight: 600; display: flex; align-items: center; gap: 0.35rem; }
.notebook-nav { display: flex; align-items: center; gap: 0.4rem; padding: 0.7rem 1rem; border-bottom: 1px solid rgba(128,128,128,0.08); flex-wrap: wrap; }
.notebook-nav-btn { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.9rem; transition: all 0.25s; font-family: 'Vazirmatn', sans-serif; font-weight: 700; }
.notebook-nav-btn:hover:not(:disabled) { transform: scale(1.08); }
.notebook-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.notebook-nav-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.notebook-page-num { padding: 0.5rem 0.9rem; border-radius: 10px; font-size: 0.82rem; font-weight: 800; display: flex; align-items: center; gap: 0.4rem; font-variant-numeric: tabular-nums; cursor: pointer; transition: all 0.25s; user-select: none; }
.notebook-page-num:hover { transform: scale(1.05); }
.notebook-jump-input { width: 55px; padding: 0.4rem 0.5rem; border-radius: 8px; font-size: 0.8rem; font-family: 'Vazirmatn', sans-serif; text-align: center; outline: none; font-weight: 700; transition: all 0.25s; }
.notebook-page { position: relative; min-height: 420px; max-height: 60vh; overflow-y: auto; overflow-x: hidden; direction: rtl; }
.notebook-page::-webkit-scrollbar { width: 8px; }
.notebook-page::-webkit-scrollbar-track { background: rgba(128,128,128,0.05); }
.notebook-page::-webkit-scrollbar-thumb { background: rgba(0,114,255,0.25); border-radius: 4px; }
.notebook-page::before { content: ''; position: absolute; top: 30px; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 1; }
.notebook-textarea { position: relative; z-index: 2; width: 100%; min-height: 420px; padding: 8px 22px 20px 22px; border: none; outline: none; background: transparent; font-family: 'Vazirmatn', sans-serif; font-size: 16px; line-height: 32px; resize: none; direction: rtl; text-align: right; word-wrap: break-word; white-space: pre-wrap; overflow-wrap: break-word; }
.notebook-textarea::placeholder { font-style: italic; opacity: 0.7; }
.notebook-footer { padding: 0.7rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; font-size: 0.72rem; }
.notebook-info { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.notebook-info .info-item { display: flex; align-items: center; gap: 0.25rem; font-weight: 600; }
.notebook-info svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.notebook-clear-btn { padding: 0.45rem 0.85rem; border-radius: 9px; font-size: 0.72rem; font-weight: 700; cursor: pointer; font-family: 'Vazirmatn', sans-serif; border: 1px solid rgba(255,82,82,0.25); background: rgba(255,82,82,0.08); color: #ff5252; transition: all 0.25s; display: flex; align-items: center; gap: 0.3rem; }
.notebook-clear-btn:hover { background: rgba(255,82,82,0.18); transform: scale(1.05); }

/* ===== تایمر ===== */
.timer-form { display: flex; flex-direction: column; gap: 1rem; }
.timer-form-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 0.7rem; align-items: end; }
.timer-field { display: flex; flex-direction: column; gap: 0.4rem; align-items: stretch; }
.timer-field input { width: 100%; padding: 0.75rem 0.5rem; border-radius: 11px; font-size: 1rem; font-weight: 700; font-family: 'Vazirmatn', sans-serif; outline: none; text-align: center; transition: all 0.25s; direction: ltr; }
.timer-field input[type="text"] { text-align: right; direction: rtl; font-weight: 600; font-size: 0.9rem; }
.timer-field input[type="number"]::-webkit-outer-spin-button,
.timer-field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.timer-field input[type="number"] { -moz-appearance: textfield; }
.timer-field-label { font-size: 0.7rem; font-weight: 700; text-align: center; opacity: 0.7; }
body.dark .timer-field-label { color: #8899b3; }
body.light .timer-field-label { color: #5a6a82; }
.timer-add-btn { width: 100%; justify-content: center; padding: 0.9rem 1.3rem; font-size: 0.9rem; }
.timers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-top: 1rem; }
.timer-card { border-radius: 22px; padding: 1.2rem 1rem; display: flex; flex-direction: column; gap: 0.7rem; animation: slideIn 0.4s; transition: all 0.35s; position: relative; }
.timer-card.active { transform: translateY(-2px); }
.timer-card .tc-title { font-size: 0.92rem; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-card .tc-date { font-size: 0.62rem; text-align: center; margin-bottom: 0.2rem; }
.timer-ring-wrap { position: relative; width: 170px; height: 170px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.timer-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke 0.3s; }
.timer-ring-wrap.active .ring-progress { animation: ringPulse 2s ease-in-out infinite; }
.ring-progress.warning { stroke: #fbbf24 !important; }
.ring-progress.danger { stroke: #ff5252 !important; animation: pulse 1s infinite; }
.timer-time { font-size: 2.1rem; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: 1px; direction: ltr; z-index: 2; color: #0072ff; transition: color 0.3s; }
body.dark .timer-time { color: #4da3ff; }
.timer-time.warning { color: #fbbf24 !important; }
.timer-time.danger { color: #ff5252 !important; }
.timer-status { font-size: 0.62rem; text-align: center; font-weight: 600; margin-top: -0.3rem; }
.timer-controls { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.3rem; }
.timer-btn { width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.timer-btn:hover { transform: scale(1.1); }
.timer-btn:active { transform: scale(0.95); }
.timer-btn.primary { background: linear-gradient(135deg, #00a8ff, #0072ff); color: #fff !important; width: 54px; height: 54px; box-shadow: 0 6px 20px rgba(0,114,255,0.4); }
.timer-btn.primary.pause { background: linear-gradient(135deg, #fbbf24, #d97706); box-shadow: 0 6px 20px rgba(251,191,36,0.4); }
.timer-btn.primary:hover { box-shadow: 0 10px 30px rgba(0,114,255,0.6); }
.timer-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.timer-btn.primary svg { width: 24px; height: 24px; }

/* ===== تب‌های داخلی تایمر ===== */
.timer-subtabs {
    display: flex;
    gap: 0.3rem;
    padding: 0.35rem;
    border-radius: 14px;
    margin-bottom: 1rem;
}
.timer-subtab-btn {
    flex: 1;
    padding: 0.7rem 0.8rem;
    border-radius: 11px;
    border: none;
    background: transparent;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}
.timer-subtab-btn.active { background: rgba(0,114,255,0.15); color: #4da3ff; }
body.light .timer-subtab-btn.active { background: rgba(0,114,255,0.1); color: #0072ff; }

/* ===== کرنومتر ===== */
.stopwatch-main {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 20px;
    margin-bottom: 1.2rem;
}
.stopwatch-display {
    font-size: 3.5rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    direction: ltr;
    color: #4da3ff;
    line-height: 1;
    text-shadow: 0 0 30px rgba(0,114,255,0.4);
}
body.light .stopwatch-display { color: #0072ff; }
.stopwatch-ms {
    font-size: 1.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    margin-top: 0.3rem;
    direction: ltr;
}
.stopwatch-controls {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 1.2rem;
}
.stopwatch-controls .timer-btn { width: 56px; height: 56px; }
.stopwatch-controls .timer-btn.primary { width: 70px; height: 70px; }
.stopwatch-controls .timer-btn.primary svg { width: 30px; height: 30px; }
.stopwatch-laps {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.stopwatch-lap-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    border-radius: 11px;
    font-size: 0.85rem;
    font-weight: 700;
}
.stopwatch-lap-item .lap-num { font-weight: 600; }
.stopwatch-lap-item .lap-time { color: #4da3ff; font-variant-numeric: tabular-nums; direction: ltr; }
.stopwatch-lap-item .lap-diff { color: #22c55e; font-size: 0.72rem; font-variant-numeric: tabular-nums; }

/* ===== خواب و بیداری ===== */
.sleep-card { border-radius: 18px; padding: 1.3rem; margin-bottom: 1rem; transition: all 0.3s; }
.sleep-loaders { display: flex; justify-content: space-around; gap: 1rem; margin: 1.2rem 0; padding: 0.5rem 0; }
.sleep-loader-item { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; flex: 1; }
.sleep-loader-ring { position: relative; width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; }
.sleep-loader-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.sleep-loader-ring .slr-bg { fill: none; stroke-width: 8; }
.sleep-loader-ring .slr-progress { fill: none; stroke: #a855f7; stroke-width: 8; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1s cubic-bezier(0.23, 1, 0.32, 1), stroke 0.3s; filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.5)); }
.sleep-loader-ring .slr-progress.wake { stroke: #f59e0b; filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.5)); }
.sleep-loader-ring .slr-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.sleep-loader-ring .slr-icon { font-size: 1.3rem; line-height: 1; }
.sleep-loader-ring .slr-time { font-size: 0.95rem; font-weight: 900; direction: ltr; font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
.sleep-loader-label { font-size: 0.78rem; font-weight: 700; }
.sleep-duration-display { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.9rem 1rem; border-radius: 14px; margin: 1rem 0; }
.sleep-duration-display .sdd-icon { font-size: 1.4rem; }
.sleep-duration-display .sdd-text { font-size: 1.3rem; font-weight: 900; }
.sleep-duration-display .sdd-label { font-size: 0.7rem; opacity: 0.7; }
.alarm-buttons-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-top: 1rem; }
.alarm-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; padding: 1rem 0.5rem; border-radius: 16px; border: 2px solid; cursor: pointer; font-family: 'Vazirmatn', sans-serif; transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1); position: relative; overflow: hidden; background: transparent; }
.alarm-btn.off { background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(220, 38, 38, 0.08)); border-color: rgba(239, 68, 68, 0.5); color: #ef4444; }
.alarm-btn.off:hover { background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.15)); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3); }
.alarm-btn.on { background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(22, 163, 74, 0.1)); border-color: rgba(34, 197, 94, 0.6); color: #22c55e; box-shadow: 0 0 25px rgba(34, 197, 94, 0.25), inset 0 0 20px rgba(34, 197, 94, 0.05); }
.alarm-btn.on:hover { background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(22, 163, 74, 0.15)); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(34, 197, 94, 0.4); }
.alarm-btn .ab-icon { font-size: 1.6rem; transition: transform 0.3s; }
.alarm-btn.on .ab-icon { animation: sleepPulse 2s ease-in-out infinite; }
.alarm-btn .ab-status { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.3px; }
.alarm-btn .ab-label { font-size: 0.7rem; font-weight: 700; opacity: 0.85; }
.sleep-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 1rem 0; }
.sleep-stat { text-align: center; padding: 0.8rem 0.4rem; border-radius: 13px; transition: all 0.25s; }
.sleep-stat .ss-num { font-size: 1.1rem; font-weight: 800; }
.sleep-stat .ss-label { font-size: 0.62rem; margin-top: 0.15rem; opacity: 0.7; }
.sleep-history { max-height: 400px; overflow-y: auto; padding-left: 0.3rem; margin-top: 0.5rem; }
.sleep-history::-webkit-scrollbar { width: 5px; }
.sleep-history::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.3); border-radius: 3px; }
.sleep-history-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 0.9rem; border-radius: 12px; margin-bottom: 0.4rem; font-size: 0.82rem; transition: all 0.25s; }
.sleep-history-item:hover { transform: translateX(-2px); }
.sleep-history-item .sh-date { flex: 1; font-weight: 600; display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; }
.sleep-history-item .sh-times { display: flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; opacity: 0.85; }
.sleep-history-item .sh-duration { font-weight: 800; font-size: 0.85rem; min-width: 55px; text-align: center; }
.sleep-history-item .sh-del { background: none; border: none; cursor: pointer; padding: 0.3rem; border-radius: 7px; transition: all 0.25s; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; }
.sleep-history-item .sh-del svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ===== ورودی متنی ساعت (خواب و بیداری) ===== */
.time-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.time-input-label {
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.time-text-input {
    width: 100%;
    padding: 1rem;
    border-radius: 14px;
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Vazirmatn', sans-serif;
    text-align: center;
    direction: ltr;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    outline: none;
    transition: all 0.25s;
    border: 2px solid rgba(168,85,247,0.2);
    background: rgba(0,0,0,0.3);
    color: #a855f7;
}
body.light .time-text-input { background: rgba(255,255,255,0.9); }
.time-text-input:focus {
    border-color: rgba(168,85,247,0.7);
    box-shadow: 0 0 25px rgba(168,85,247,0.25);
}
.time-text-input.valid { border-color: rgba(34,197,94,0.6); }
.time-text-input.invalid { border-color: rgba(255,82,82,0.7); }
.time-hint {
    font-size: 0.65rem;
    opacity: 0.6;
    text-align: center;
}
.sleep-inputs-custom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

/* ===== توست بزرگ خواب ===== */
.sleep-big-toast { position: fixed; top: 80px; left: 50%; transform: translateX(-50%) translateY(-200px); border-radius: 20px; padding: 1.2rem 1.5rem; display: flex; align-items: center; gap: 1rem; z-index: 999999; opacity: 0; transition: all 0.5s cubic-bezier(0.23,1,0.32,1); max-width: 90%; width: 400px; backdrop-filter: blur(20px); }
.sleep-big-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.sbt-icon { font-size: 2.5rem; flex-shrink: 0; animation: sleepPulse 1.5s ease-in-out infinite; }
.sbt-content { flex: 1; min-width: 0; }
.sbt-title { font-size: 1rem; font-weight: 800; margin-bottom: 0.3rem; }
.sbt-body { font-size: 0.82rem; line-height: 1.5; }
.sbt-close { background: rgba(255,82,82,0.15); border: none; color: #ff5252; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.25s; }
.sbt-close:hover { background: rgba(255,82,82,0.3); transform: rotate(90deg); }

/* ===== نوار پایین ===== */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; width: 100%; z-index: 9999; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding-bottom: env(safe-area-inset-bottom, 0px); transition: background 0.3s, border-color 0.3s; }
.bottom-nav-inner { display: flex; align-items: stretch; justify-content: space-around; max-width: 980px; margin: 0 auto; padding: 0.4rem 0.2rem; }
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; padding: 0.55rem 0.3rem; border: none; background: transparent; font-family: 'Vazirmatn', sans-serif; font-size: 0.6rem; font-weight: 700; cursor: pointer; transition: all 0.25s; position: relative; max-width: 100px; }
.nav-btn svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.25s; }
.nav-btn.active svg { transform: scale(1.15); }
.nav-btn .nav-indicator { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 0; height: 3px; border-radius: 0 0 3px 3px; transition: width 0.3s; }
.nav-btn.active .nav-indicator { width: 28px; }

/* ===== توست ===== */
.save-toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(100px); background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; padding: 0.7rem 1.4rem; border-radius: 12px; font-size: 0.82rem; font-weight: 600; box-shadow: 0 8px 25px rgba(34,197,94,0.4); z-index: 99999; opacity: 0; transition: all 0.4s cubic-bezier(0.23,1,0.32,1); pointer-events: none; display: flex; align-items: center; gap: 0.5rem; }
.save-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== مودال ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(8px); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 1.5rem; }
.modal-overlay.open { display: flex; animation: pageIn 0.25s ease; }
.modal-content { max-width: 580px; width: 100%; max-height: 82vh; overflow-y: auto; border-radius: 22px; padding: 1.8rem; position: relative; animation: slideIn 0.3s; }
.modal-close { position: absolute; top: 0.9rem; left: 0.9rem; border: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.modal-close:hover { transform: rotate(90deg); }
.modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.8rem; padding-left: 2.8rem; display: flex; align-items: center; gap: 0.45rem; }
.modal-date { font-size: 0.72rem; margin-bottom: 1.2rem; display: flex; align-items: center; gap: 0.35rem; }
.modal-full-text { font-size: 0.95rem; line-height: 1.9; white-space: pre-wrap; word-wrap: break-word; }
.modal-actions { display: flex; gap: 0.4rem; margin-top: 1.2rem; padding-top: 0.9rem; border-top: 1px solid rgba(128,128,128,0.1); flex-wrap: wrap; }
.btn-modal { padding: 0.55rem 1.1rem; border-radius: 9px; font-size: 0.78rem; font-weight: 600; cursor: pointer; font-family: 'Vazirmatn', sans-serif; border: none; display: inline-flex; align-items: center; gap: 0.35rem; transition: all 0.25s; }
.btn-modal:hover { transform: scale(1.05); }
.btn-modal.pin { background: rgba(251,191,36,0.1); color: #fbbf24; border: 1px solid rgba(251,191,36,0.2); }
.btn-modal.del { background: rgba(255,82,82,0.1); color: #ff5252; border: 1px solid rgba(255,82,82,0.2); }
.btn-modal.edit { background: rgba(0,114,255,0.1); color: #0072ff; border: 1px solid rgba(0,114,255,0.2); }
.btn-modal.save { background: rgba(34,197,94,0.1); color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.btn-modal.cancel { background: rgba(128,128,128,0.1); color: #888; border: 1px solid rgba(128,128,128,0.2); }
.edit-textarea { width: 100%; min-height: 180px; padding: 0.9rem; border-radius: 13px; font-family: 'Vazirmatn', sans-serif; font-size: 0.95rem; line-height: 1.9; resize: vertical; outline: none; }

/* ===== ریسپانسیو ===== */
@media (max-width: 768px) {
    .header-inner { padding: 0.7rem 1rem; }
    .header-title { font-size: 0.9rem; }
    .header-date { font-size: 0.68rem; }
    .theme-toggle { width: 38px; height: 38px; font-size: 1rem; }
    .content { padding: 1.2rem 1rem 1rem; }
    .nav-btn { font-size: 0.55rem; }
    .nav-btn svg { width: 20px; height: 20px; }
    .cal-day { min-height: 46px; }
    .cal-day .day-num { font-size: 0.75rem; }
    .cal-day .holiday-name { font-size: 0.38rem; }
    .chart-wrapper { height: 260px; }
    .chart-y-axis { height: 260px; }
    .chart-y-axis canvas { height: 260px; }
    .chart-scroll { height: 260px; }
    .chart-scroll canvas { height: 260px; }
    .notes-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
    .notebook-page { min-height: 380px; }
    .notebook-textarea { min-height: 380px; font-size: 15px; line-height: 30px; }
    .notebook-page::before { top: 28px; }
    .timer-ring-wrap { width: 150px; height: 150px; }
    .timer-time { font-size: 1.9rem; }
    .timers-grid { grid-template-columns: 1fr; }
    .sleep-big-toast { width: calc(100% - 2rem); padding: 1rem 1.2rem; top: 70px; }
    .sbt-icon { font-size: 2rem; }
    .sbt-title { font-size: 0.9rem; }
    .sbt-body { font-size: 0.75rem; }
    .timer-form-row { grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
    .timer-field-title { grid-column: 1 / -1; }
    .timer-field input { font-size: 0.95rem; padding: 0.7rem 0.4rem; }
    .timer-field-label { font-size: 0.65rem; }
}

@media (max-width: 480px) {
    .header-inner { padding: 0.6rem 0.8rem; gap: 0.4rem; }
    .header-title { font-size: 0.85rem; gap: 0.35rem; }
    .header-title .dot { width: 6px; height: 6px; }
    .header-date { font-size: 0.62rem; gap: 0.25rem; }
    .theme-toggle { width: 34px; height: 34px; font-size: 0.9rem; }
    .content { padding: 1rem 0.8rem 1rem; }
    .nav-btn { font-size: 0.5rem; padding: 0.5rem 0.2rem; }
    .nav-btn svg { width: 19px; height: 19px; }
    .cal-day { min-height: 42px; }
    .cal-day .holiday-name { font-size: 0.35rem; }
    .board-section { padding: 1.1rem 1rem; }
    .board-input { font-size: 0.92rem; padding: 0.85rem 0.95rem; }
    .form-grid { grid-template-columns: 1fr; }
    .stat-box .num { font-size: 1.25rem; }
    .task-item { padding: 0.8rem 0.9rem; gap: 0.7rem; }
    .filter-tab-btn { font-size: 0.7rem; padding: 0.55rem 0.2rem; }
    .notes-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .note-card { padding: 0.75rem 0.8rem; min-height: 110px; }
    .note-card .note-text { font-size: 0.78rem; }
    .note-form { flex-direction: column; align-items: stretch; }
    .note-form textarea { min-width: auto; }
    .btn-primary { width: 100%; justify-content: center; }
    .modal-content { padding: 1.3rem 1rem; }
    .notebook-textarea { padding: 8px 16px 16px 16px; font-size: 15px; }
    .notebook-page { min-height: 340px; max-height: 55vh; }
    .notebook-textarea { min-height: 340px; }
    .form-row { flex-direction: column; align-items: stretch; }
    .sleep-inputs-custom { grid-template-columns: 1fr; }
    .sleep-loader-ring { width: 100px; height: 100px; }
    .sleep-loader-ring .slr-time { font-size: 0.85rem; }
    .sleep-loader-ring .slr-icon { font-size: 1.1rem; }
    .sleep-loader-ring .slr-progress,
    .sleep-loader-ring .slr-bg { stroke-width: 7; }
    .alarm-btn { padding: 0.85rem 0.4rem; }
    .alarm-btn .ab-icon { font-size: 1.35rem; }
    .alarm-btn .ab-status { font-size: 0.7rem; }
    .alarm-btn .ab-label { font-size: 0.65rem; }
    .timer-ring-wrap { width: 140px; height: 140px; }
    .timer-time { font-size: 1.75rem; }
    .timer-btn { width: 40px; height: 40px; }
    .timer-btn.primary { width: 48px; height: 48px; }
    .sleep-history-item { flex-wrap: wrap; }
    .sleep-history-item .sh-date { flex-basis: 100%; }
    .sleep-big-toast { width: calc(100% - 1.5rem); padding: 1rem 1rem; top: 60px; }
    .sbt-icon { font-size: 1.8rem; }
    .stopwatch-display { font-size: 2.5rem; }
    .stopwatch-ms { font-size: 1.2rem; }
    .stopwatch-controls .timer-btn { width: 48px; height: 48px; }
    .stopwatch-controls .timer-btn.primary { width: 60px; height: 60px; }
    .stopwatch-controls .timer-btn.primary svg { width: 26px; height: 26px; }
}

@media (max-width: 360px) {
    .timer-field input { font-size: 0.85rem; padding: 0.6rem 0.3rem; }
    .timer-field-label { font-size: 0.6rem; }
    .time-text-input { font-size: 1.3rem; padding: 0.8rem; }
    .stopwatch-display { font-size: 2rem; }
}