.dnevnik-wrap {

    margin: 20px auto;
    padding: 0 12px;
    color: #1f2937;
}

.dnevnik-head {
    margin-bottom: 16px;
}

.dnevnik-head h1 {
    margin: 0 0 6px;
    font-size: 28px;
}

.dnevnik-head p {
    margin: 0;
    color: #6b7280;
}

.dnevnik-auth-prompt {
    margin-top: 8px !important;
    font-size: 14px;
}

.dnevnik-auth-prompt a {
    color: #2563eb;
    text-decoration: none;
}

.dnevnik-auth-prompt a:hover {
    text-decoration: underline;
}

.dnevnik-grid-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
    margin-bottom: 12px;
}

.dnevnik-layout {
    display: block;
    margin-bottom: 12px;
}

.dnevnik-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

#dnevnik-app > .dnevnik-card {
    margin-bottom: 12px;
}

.dnevnik-card h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.dnevnik-card-title {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 8px;
}

.dnevnik-card-value {
    font-size: 30px;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
}

.dnevnik-card-sub {
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
}

.dnevnik-form-row {
    margin-bottom: 12px;
}

.dnevnik-form-row label {
    display: block;
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 5px;
}

.dnevnik-form-row input[type="number"],
.dnevnik-form-row textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #111827;
}

.dnevnik-form-row input[type="range"] {
    width: 100%;
    accent-color: #2563eb;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: #dbeafe;
    outline: none;
}

.dnevnik-form-row input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: #dbeafe;
}

.dnevnik-form-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #1d4ed8;
    background: #2563eb;
    margin-top: -5px;
    cursor: pointer;
}

.dnevnik-form-row input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: #dbeafe;
}

.dnevnik-form-row input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #1d4ed8;
    background: #2563eb;
    cursor: pointer;
}

.dnevnik-range-value {
    margin-top: 4px;
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
}

.dnevnik-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dnevnik-btn {
    background: #2563eb;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.dnevnik-btn:hover {
    background: #1d4ed8;
}

.dnevnik-btn-soft {
    background: #eef2ff;
    color: #1e3a8a;
}

.dnevnik-btn-soft:hover {
    background: #e0e7ff;
}

.dnevnik-status {
    font-size: 13px;
    color: #6b7280;
}

.dnevnik-chart {
    min-height: 170px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px;
    background: linear-gradient(to top, #f9fafb 0%, #ffffff 100%);
}

.dnevnik-bar {
    flex: 1 1 0;
    min-width: 6px;
    border-radius: 4px 4px 2px 2px;
    background: #93c5fd;
    transition: 0.25s ease;
}

.dnevnik-bar.is-today {
    background: #2563eb;
}

.dnevnik-bar.is-active {
    outline: 2px solid #1d4ed8;
    outline-offset: 1px;
}

.dnevnik-bar.tasks {
    background: #c4b5fd;
}

.dnevnik-bar.tasks.is-today {
    background: #7c3aed;
}

.dnevnik-chart-range {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: #6b7280;
}

.dnevnik-chart-info {
    margin-top: 8px;
    font-size: 13px;
    color: #374151;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
}

.dnevnik-heatmap {
    display: grid;
    grid-template-columns: repeat(53, minmax(0, 1fr));
    gap: 3px;
    overflow-x: visible;
    padding-bottom: 4px;
}

.dnevnik-heat-cell {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 2px;
    background: #e5e7eb;
}

.dnevnik-heat-l1 { background: #bfdbfe; }
.dnevnik-heat-l2 { background: #93c5fd; }
.dnevnik-heat-l3 { background: #60a5fa; }
.dnevnik-heat-l4 { background: #2563eb; }
.dnevnik-heat-l5 { background: #1d4ed8; }
.dnevnik-heat-l6 { background: #1e3a8a; }

.dnevnik-plan-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
    margin-bottom: 10px;
}

.dnevnik-plan-controls label {
    font-size: 13px;
    color: #4b5563;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dnevnik-plan-controls input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
}

.dnevnik-line-chart {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: linear-gradient(to top, #f9fafb 0%, #ffffff 100%);
    padding: 8px;
    min-height: 190px;
}

.dnevnik-score-actions {
    margin-bottom: 12px;
}

.dnevnik-score-form {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    padding: 12px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 12px;
    align-items: start;
}

.dnevnik-score-form label,
.dnevnik-score-chart-controls label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #4b5563;
}

.dnevnik-score-form input,
.dnevnik-score-form select,
.dnevnik-score-chart-controls select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.dnevnik-score-form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.dnevnik-score-subjects {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
    margin-top: 10px;
}

.dnevnik-score-subject {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    background: #fff;
    display: grid;
    grid-template-columns: minmax(200px, 1.2fr) minmax(170px, 220px) minmax(170px, 220px) auto;
    gap: 10px;
    align-items: start;
}

.dnevnik-score-subject-name {
    font-weight: 600;
    line-height: 1.3;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.dnevnik-score-subject label {
    min-width: 0;
}

.dnevnik-score-subject input {
    width: 100%;
    box-sizing: border-box;
}

.dnevnik-score-subject .dv-subject-remove {
    align-self: end;
}

.dnevnik-spoiler {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.dnevnik-spoiler > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    user-select: none;
}

.dnevnik-spoiler > summary + * {
    margin-top: 10px;
}

.dnevnik-score-chart-controls {
    display: grid;
    grid-template-columns: minmax(220px, 320px) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

.dnevnik-score-subject .dnevnik-btn,
.dnevnik-score-chart-controls .dnevnik-btn,
.dnevnik-score-form .dnevnik-btn {
    white-space: nowrap;
}

.dnevnik-score-point-actions {
    margin-top: 10px;
}

.dnevnik-favorites-list {
    display: grid;
    gap: 8px;
}

.dnevnik-favorites-item {
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    color: #1f2937;
    text-decoration: none;
    background: #fff;
}

.dnevnik-favorites-item:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.dnevnik-favorites-actions {
    margin-top: 10px;
}

.dnevnik-checklist-add {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
}

.dnevnik-checklist-add input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.dnevnik-checklist-list {
    display: grid;
    gap: 8px;
}

.dnevnik-checklist-item {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
}

.dnevnik-checklist-item.done .dnevnik-checklist-text {
    text-decoration: line-through;
    color: #94a3b8;
}

.dnevnik-checklist-text {
    min-width: 0;
    word-break: break-word;
}

.dnevnik-notes-wrap {
    display: grid;
    gap: 10px;
}

.dnevnik-notes-text {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    background: #fff;
    color: #111827;
    resize: vertical;
    box-sizing: border-box;
}

.dnevnik-notes-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 920px) {
    .dnevnik-score-subject {
        grid-template-columns: 1fr;
    }

    .dnevnik-score-chart-controls {
        grid-template-columns: 1fr;
    }
}

.dnevnik-legend {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.dnevnik-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: #2563eb;
    margin-right: 6px;
}

.dnevnik-legend i.dnevnik-legend-max {
    background: #1e3a8a;
}

.dnevnik-heatmap-scale {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 12px;
    color: #6b7280;
}

.dnevnik-heatmap-scale span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dnevnik-heatmap-scale .dnevnik-heat-cell {
    width: 12px;
    min-width: 12px;
    aspect-ratio: 1 / 1;
}

.dnevnik-recent-item {
    border-top: 1px solid #f1f5f9;
    padding: 10px 0;
    font-size: 14px;
}

.dnevnik-recent-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.dnevnik-recent-date {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 2px;
}

.dnevnik-recent-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dnevnik-recent-comment {
    margin-top: 4px;
    color: #374151;
}

.dnevnik-box {
    max-width: 600px;
    margin: 40px auto;
    text-align: center;
}

.dnevnik-pomo {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.dnevnik-pomo-time {
    font-size: 44px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 1px;
}

.dnevnik-pomo-sub {
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
}

.dnevnik-pomo-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.dnevnik-pomo-durations {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.dnevnik-pomo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.dnevnik-pomo-meta span {
    font-size: 12px;
    color: #374151;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 5px 10px;
}

.dnevnik-pomo-dur {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
}

.dnevnik-pomo-dur.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}

.dnevnik-pomo-progress {
    height: 10px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.dnevnik-pomo-progress-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
    transition: width 0.2s linear;
}

.dnevnik-pomo-text {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.4;
    color: #6b7280;
}

@media (max-width: 900px) {
    .dnevnik-grid-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dnevnik-pomo {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .dnevnik-grid-cards {
        grid-template-columns: 1fr;
    }
}

