* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; background: #f0f3f7; padding: 24px; }
.app { max-width: 760px; margin: 0 auto; background:#fff; border-radius:12px; box-shadow: 0 14px 30px rgba(41,63,91,.15); overflow:hidden; }
header { background: #4f76d9; color:#fff; padding: 18px 20px; }
header h1 { font-size:1.45rem; }
header p.author { color: #e0e7ff; margin-top: 4px; font-size: 0.95rem; font-style: italic; }
main { padding: 18px; }

body.dark { background: #0f172a; color: #e2e8f0; }
body.dark .app { background: #1e293b; box-shadow: 0 14px 30px rgba(0,0,0,.45); }
body.dark header { background: #1e3a8a; color: #f8fafc; }
body.dark .note-input input, body.dark .note-input textarea, body.dark .note-filter input, body.dark .note-actions-global select, body.dark .note-actions-global button, body.dark .drawing-controls select, body.dark .drawing-controls button { background: #1e293b; border: 1px solid #334155; color: #e2e8f0; }
body.dark .note-actions-global .import-btn { color: #e2e8f0; }
body.dark .note, body.dark .notes-list div { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.dark .note-actions .edit-btn { background: #2563eb; }
body.dark .note-actions .delete-btn { background: #dc2626; }

@media print {
  body, .app { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  header, .note-actions-global, .drawing-overlay, .drawing-controls, .note-input { display: none !important; }
  .notes-list { display: block !important; }
  .note { border: 1px solid #000 !important; page-break-inside: avoid; }
  .note h3, .note small, .note-text { color: #000 !important; }
}

.note-filter { margin-bottom: 10px; display: flex; gap: 8px; }
.note-filter input { flex: 1; padding: 8px 10px; border: 1px solid #cdd4dc; border-radius: 8px; font-size: 0.95rem; }
.note-filter button { border: none; background: #f5a623; color: #fff; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 0.95rem; }
.note-filter button:hover { background: #d68d1b; }
.note-input { display:flex; flex-direction:column; gap:8px; margin-bottom: 12px; }
.note-input input, .note-input textarea { width:100%; padding:10px; border:1px solid #cdd4dc; border-radius:8px; font-size:1rem; }
.note-input button { border: none; background:#4f76d9; color:#fff; padding:12px; border-radius:8px; font-size:1rem; cursor:pointer;}
.note-input button:hover { background:#365abf; }
.note-actions-global { display:flex; flex-wrap: wrap; gap:10px; align-items:center; margin-bottom: 16px; }
.note-actions-global .task-filter-group, .note-actions-global .task-sort-group, .note-actions-global .task-toggle-group { display:flex; align-items:center; gap:6px; }
.note-actions-global select { padding:6px 8px; border:1px solid #cdd4dc; border-radius:6px; font-size:0.95rem; }
.note-actions-global .task-toggle-group label { font-size: 0.9rem; }
.note-actions-global .task-progress { margin-left: 6px; font-size: 0.9rem; color: #444; }
mark { background: #fff176; color: #000; font-weight: bold; }
.task-item { margin-left: 1.2rem; }
.task-item label { user-select: none; }
.task-item input[type="checkbox"] { margin-right: 8px; }
.note .note-text div { margin-bottom: 4px; }
.solution-line { display: none; color: #2f855a; font-weight: 600; margin-top: 4px; }
body.show-solutions .solution-line { display: block; }
.bravo-message { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3rem; font-weight: bold; color: #2f855a; background: rgba(255, 255, 255, 0.95); padding: 30px 50px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); z-index: 10000; animation: bravoAnimation 1.5s ease-in-out; }
@keyframes bravoAnimation { 0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; } 50% { transform: translate(-50%, -50%) scale(1.2); } 100% { transform: translate(-50%, -50%) scale(1); opacity: 0; } }

.drawing-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.drawing-overlay.hidden { display: none; }
.drawing-panel { background: #fff; border-radius: 12px; padding: 16px; max-width: 90%; width: 860px; max-height: 90%; overflow: hidden; }
.drawing-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.drawing-header h2 { margin: 0; font-size: 1.2rem; }
.drawing-header button { background: #e04f4f; border: none; color: #fff; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.drawing-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.drawing-controls select, .drawing-controls button { padding: 6px 10px; border-radius: 6px; border: 1px solid #cdd4dc; cursor: pointer; }
#draw-canvas { width: 100%; height: auto; border: 1px solid #ccd9e6; background: #fff; display: block; }
.note-actions-global button, .note-actions-global .import-btn { border: none; background:#007acc; color: white; padding: 8px 12px; border-radius: 8px; font-size: 0.95rem; cursor: pointer; }
..note-actions-global button:hover, .note-actions-global .import-btn:hover { background: #005fa1; }
.note-actions-global #note-count { color: #333; font-style: italic; }
.note-actions-global .import-btn { display: inline-flex; align-items: center; justify-content: center; }
.helper-sections {
    margin: 20px 0;
    text-align: left;
}
summary {
    background: #f0f4f8;
    padding: 10px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    margin-bottom: 5px;
    list-style: none;
    border: 1px solid #d1d5db;
}
.formulas {
    background: #fff;
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.multiplication-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    background: #fff;
    padding: 10px;
    font-size: 12px;
}
.grid-item {
    border: 1px solid #eee;
    padding: 5px;
    text-align: center;
}
.formulas ul { list-style: none; padding-left: 0; }
.formulas li { margin-bottom: 8px; font-size: 0.95rem; color: #334155; }
.notes-list { display:grid; gap:12px; }
.note { background:#f8faff; border:1px solid #d1dbef; border-radius:8px; padding:12px; }
.note-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.note h3 { margin: 0; }
.note-status { background: #e2e8f0; color: #0f172a; border-radius: 999px; padding: 4px 10px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; }
.note small { color:#666; }
.answer-section { background: #e8f4f8; border-left: 4px solid #0066cc; padding: 10px; margin: 12px 0; border-radius: 4px; }
.answer-section label { font-size: 0.95rem; color: #333; display: block; margin-bottom: 6px; }
.answer-input { width: 100%; padding: 8px; border: 1px solid #0066cc; border-radius: 4px; font-size: 0.9rem; font-family: inherit; }
.save-answer-btn, .check-answer-btn { background: #0066cc; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; margin-top: 6px; margin-right: 4px; }
.save-answer-btn:hover, .check-answer-btn:hover { background: #0052a3; }
.check-result { margin-top: 8px; font-weight: 600; font-size: 0.95rem; }
.correct-badge { color: #2f855a; background: #c6f6d5; padding: 8px; border-radius: 4px; border-left: 4px solid #2f855a; }
.incorrect-badge { color: #c53030; background: #fed7d7; padding: 8px; border-radius: 4px; border-left: 4px solid #c53030; }
.correct-answer-section { background: #f0f9ff; border-left: 4px solid #2563eb; padding: 10px; margin: 8px 0; border-radius: 4px; font-size: 0.9rem; }
.correct-answer-text { font-weight: 600; color: #1e40af; }
body.dark .answer-section { background: #1a3a52; border-color: #0088ff; }
body.dark .answer-input { background: #0f172a; border-color: #0088ff; color: #e2e8f0; }
body.dark .save-answer-btn, body.dark .check-answer-btn { background: #0088ff; }
body.dark .correct-answer-section { background: #1e3a8a; border-color: #60a5fa; }
body.dark .correct-answer-text { color: #93c5fd; }
.note-actions { display: flex; gap: 8px; margin-top: 10px; }
.note-actions button { margin-top: 0; border: none; color: white; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.note-actions .edit-btn { background: #4f76d9; }
.note-actions .delete-btn { background: #e94e4e; }
.note-actions button:hover { opacity:.9; }
.empty { color:#657788; text-align:center; padding:28px 0; }
.notes-list div {
    background: #fff9c4; /* Жълт цвят като истинско листче */
    border-left: 5px solid #fbc02d;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    margin-top: 10px;
    padding: 15px;
    border-radius: 4px;
}