* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg-page);
    color: var(--text-body);
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: var(--ls-tight);
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 16px;
    position: relative;
}

.logo {
    display: block;
    margin: 0 auto 8px;
    max-width: 180px;
}

.brand-logo {
    text-align: center;
    margin: 6px auto 22px;
}
.brand-logo svg {
    width: 100%;
    max-width: 300px;
    height: auto;
}
.brand-logo svg text {
    font-family: var(--font-display);
}

.by-akademia {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    opacity: 0.9;
}
.by-akademia span {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    font-weight: 600;
}
.by-akademia img {
    height: 36px;
    width: auto;
}
.footer a { color: var(--teal-300); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

h1 {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 24px;
    color: #fff;
}

h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: #333;
}

h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: #555;
}

.step {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.przedmiot-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.przedmiot-btn,
.poziom-btn {
    flex: 1;
    min-width: 140px;
    padding: 20px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.przedmiot-btn:hover,
.poziom-btn:hover {
    border-color: var(--accent);
    background: #f8f9ff;
    transform: translateY(-2px);
}

.przedmiot-header {
    text-align: center;
    margin-bottom: 16px;
}

.aktualny-przedmiot {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 12px;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #555;
}

select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,217,182,0.18);
}

.tresc-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    border-left: 3px solid var(--accent);
}

.tresc-box p {
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.tresc-img {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 8px;
}

.punkty-info {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: var(--accent);
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: var(--accent);
    background: #eef1ff;
}

.upload-area p {
    color: #888;
    font-size: 0.95rem;
}

/* --- Chipy aktywnych filtrów (przeglądanie zadań) --- */
.filter-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--navy-700); color: #fff; font-size: 0.78rem; font-weight: 600;
    padding: 3px 6px 3px 12px; border-radius: 999px;
}
.filter-chip button {
    background: rgba(255,255,255,0.25); border: none; color: #fff; cursor: pointer;
    width: 18px; height: 18px; border-radius: 50%; font-size: 0.7rem; line-height: 1;
}
.filter-chip button:hover { background: rgba(255,255,255,0.45); }

/* --- Modal captcha (potwierdzenie oddania) --- */
.captcha-overlay {
    position: fixed; inset: 0; background: rgba(14,29,51,0.55);
    display: flex; align-items: center; justify-content: center; z-index: 500; padding: 16px;
}
.captcha-box {
    background: #fff; border-radius: 14px; padding: 22px; max-width: 380px; width: 100%;
    box-shadow: 0 18px 44px rgba(23,46,77,0.25); text-align: center;
}
.captcha-msg { font-size: 0.9rem; color: #333; margin-bottom: 14px; line-height: 1.5; }
.captcha-q { font-size: 1.15rem; font-weight: 700; color: var(--navy-800); margin-bottom: 10px; }
.captcha-input {
    width: 120px; padding: 10px; font-size: 1.1rem; text-align: center;
    border: 2px solid var(--border-default); border-radius: 10px;
}
.captcha-input:focus { outline: none; border-color: var(--teal-500); }
.captcha-err { color: #c0392b; font-size: 0.82rem; margin: 8px 0 0; }
.captcha-actions { display: flex; gap: 10px; margin-top: 16px; }
.captcha-actions .btn { margin-top: 0; }

/* --- Powiadomienie o aktualizacji --- */
.whats-new {
    background: linear-gradient(135deg, #eef2ff, #f8f9ff);
    border: 1px solid #d6ddff;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    position: relative;
}
.wn-head {
    font-weight: 700;
    color: #3a4ea8;
    font-size: 0.9rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.wn-dismiss {
    background: none;
    border: none;
    color: #8891c4;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}
.wn-title { font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; color: #333; }
.whats-new ul { margin: 0; padding-left: 18px; }
.whats-new li { font-size: 0.82rem; color: #555; margin-bottom: 3px; }

/* --- Panel główny ucznia --- */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.stat-card {
    background: #f8f9ff;
    border: 1px solid #e6e9f5;
    border-radius: 12px;
    padding: 14px 12px;
    text-align: center;
}
.stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-display);
    color: var(--teal-700);
    line-height: 1.1;
}
.stat-cap {
    font-size: 0.72rem;
    color: #777;
    margin-top: 4px;
}
.stat-sub {
    display: block;
    font-size: 0.7rem;
    color: #2e7d32;
    font-weight: 600;
}
.dash-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.dash-tile {
    position: relative;
    background: #fff;
    border: 2px solid #e6e9f5;
    border-radius: 14px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.dash-tile:hover {
    border-color: var(--accent);
    background: #f8f9ff;
    transform: translateY(-2px);
}
.dash-tile-icon { font-size: 2.2rem; }
.dash-tile-label { font-weight: 700; font-size: 1rem; color: #333; }
.dash-tile-sub { font-size: 0.75rem; color: #888; }
.dash-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    background: #e53935;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.dash-badge.dot {
    background: #f9a825;
    min-width: 16px;
    height: 16px;
    padding: 0;
    top: -6px;
    right: -6px;
}
/* Strony pracy domowej i historii na białej karcie (czytelność na granatowym tle) */
#page-homework-list, #page-homework-detail {
    background: #fff;
    border-radius: 12px;
    padding: 20px 18px;
    margin-top: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
#page-homework-list h2, #page-homework-detail h2 { color: var(--navy-800); }
.hw-task-row { background: #fff; }

/* --- Zadania domowe (lista/szczegóły) --- */
.hw-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 5px solid #ccc;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.hw-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.08); }
.hw-card.state-overdue { border-left-color: #e53935; }
.hw-card.state-in_progress { border-left-color: #f9a825; }
.hw-card.state-todo { border-left-color: #90a4ae; }
.hw-card.state-completed { border-left-color: #2e7d32; background: #f6fbf6; }
.hw-card-title { font-weight: 700; font-size: 1rem; color: #222; }
.hw-card-meta { font-size: 0.78rem; color: #777; margin-top: 4px; }
.hw-status-chip {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
    margin-top: 8px;
}
.chip-overdue { background: #ffebee; color: #c62828; }
.chip-in_progress { background: #fff8e1; color: #f57f17; }
.chip-todo { background: #eceff1; color: #546e7a; }
.chip-completed { background: #e8f5e9; color: #2e7d32; }
.hw-task-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.hw-task-row:hover { background: #f6f8ff; }
.hw-task-order {
    flex: 0 0 auto; width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    background: #eef1ff; color: var(--accent); font-weight: 700;
    border-radius: 50%; font-size: 0.8rem;
}
.hw-task-info { flex: 1 1 auto; font-size: 0.85rem; }
.hw-task-status { flex: 0 0 auto; font-size: 0.8rem; font-weight: 700; }
.hw-summary-box {
    background: #f6fbf6;
    border: 1px solid #c8e6c9;
    border-radius: 10px;
    padding: 14px;
    margin: 12px 0;
    font-size: 0.88rem;
    white-space: pre-wrap;
    line-height: 1.5;
}

.preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin: 12px 0;
    object-fit: contain;
}

.upload-subhint {
    color: #aaa;
    font-size: 0.8rem;
    margin-top: 6px;
}

.upload-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0;
}

.gallery-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
}

.gallery-order {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 50%;
}

.gallery-thumb {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
}

.gallery-thumb-file {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.gallery-name {
    flex: 1 1 auto;
    font-size: 0.8rem;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-controls {
    flex: 0 0 auto;
    display: flex;
    gap: 4px;
}

.gallery-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}

.gallery-btn:hover:not(:disabled) {
    background: #eef1ff;
    border-color: var(--accent);
}

.gallery-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.gallery-btn-del {
    color: #c0392b;
    border-color: #e0b4b4;
}

.gallery-btn-del:hover {
    background: #fdecea;
    border-color: #c0392b;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    width: 100%;
    margin-top: 12px;
}

.btn-primary {
    background: var(--cta);
    color: var(--cta-text);
    box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
    background: var(--cta-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e9ecef;
    color: #333;
}

.btn-secondary:hover {
    background: #dee2e6;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,217,182,0.18);
}

.hint {
    font-size: 0.8rem;
    color: #888;
    margin-top: 6px;
}

.ocr-result p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.ocena-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-notif-top {
    position: fixed;
    top: 16px;
    right: 68px;
    background: rgba(255,255,255,0.15);
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    opacity: 0.85;
    transition: opacity 0.2s;
    z-index: 310;
    color: #fff;
}
.btn-notif-top:hover { opacity: 1; }

.btn-menu-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.15);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
    z-index: 310;
    color: #fff;
}

.btn-menu-toggle:hover {
    opacity: 1;
}

.menu-dropdown {
    position: fixed;
    top: 56px;
    right: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    z-index: 305;
    min-width: 220px;
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    color: #333;
}

.menu-item:hover {
    background: #f0f2f5;
}

.menu-item span {
    font-weight: 500;
}

.menu-item.muted {
    opacity: 0.6;
}

.menu-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 304;
}

.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tutorial-box {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.tutorial-box h2 {
    color: #1a1a2e;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.tutorial-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #999;
}

.tutorial-close:hover {
    color: #333;
}

.tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tutorial-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.tutorial-num {
    background: var(--accent);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.tutorial-step p {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #444;
    margin: 0;
}


.wynik-box {
    border-radius: 8px;
    overflow: hidden;
}

.wynik-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    text-align: center;
}

.wynik-header.poprawne {
    background: #d4edda;
}

.wynik-header.czesciowo {
    background: #fff3cd;
}

.wynik-header.niepoprawne {
    background: #f8d7da;
}

.wynik-punkty {
    font-size: 1.3rem;
    font-weight: 700;
}

.wynik-ocena {
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-play {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 2px 6px;
}

.btn-play:hover {
    opacity: 1;
}

.uzasadnienie-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.czat-msg .btn-play {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
}

.wynik-uzasadnienie {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
}

.wynik-uzasadnienie p {
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e9ecef;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-overlay p {
    margin-top: 16px;
    color: #555;
    font-size: 0.95rem;
}

/* Error */
.error-box {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    text-align: center;
}

.error-box p {
    color: #721c24;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

/* Czat */
.czat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 28px;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(74,108,247,0.4);
    z-index: 200;
    transition: all 0.2s;
}

.czat-toggle:hover {
    background: var(--accent-strong);
    transform: translateY(-2px);
}

.czat-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    max-height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    z-index: 201;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.czat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.czat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.8;
}

.czat-close:hover {
    opacity: 1;
}

.czat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-height: 340px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.czat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.czat-msg p {
    margin: 0;
    white-space: pre-wrap;
}

.czat-msg.korepetytor {
    background: #f0f2f5;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.czat-msg.uczen {
    background: var(--accent);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.czat-msg.typing {
    background: #f0f2f5;
    color: #999;
    align-self: flex-start;
    font-style: italic;
}

.czat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eee;
}

.czat-input-area textarea {
    flex: 1;
    resize: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.88rem;
}

.czat-send-btn {
    width: auto;
    margin-top: 0;
    padding: 8px 16px;
    border-radius: 8px;
    align-self: flex-end;
}

.klucz-details {
    margin-top: 16px;
}

.klucz-details summary {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    padding: 8px 0;
}

.klucz-details summary:hover {
    color: var(--accent-strong);
}

.klucz-content {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.footer {
    text-align: center;
    padding: 32px 16px 16px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
}

.footer p {
    margin: 4px 0;
}

.btn-cofnij {
    display: block;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 12px;
    padding: 4px 0;
}

.btn-cofnij:hover {
    text-decoration: underline;
}

.upload-hint {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 12px;
    line-height: 1.5;
}

.abcd-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.abcd-btn {
    flex: 1; min-width: 45%; padding: 14px 16px; border: 2px solid #e0e0e0;
    border-radius: 10px; background: #fff; font-size: 0.9rem; cursor: pointer;
    transition: all 0.2s; text-align: left;
}
.abcd-btn:hover { border-color: var(--accent); background: #f8f9ff; }
.abcd-btn.selected { border-color: var(--accent); background: #eef1ff; font-weight: 600; }

.pf-group { margin-bottom: 12px; }
.pf-statement { font-size: 0.9rem; margin-bottom: 6px; line-height: 1.5; }
.pf-btns { display: flex; gap: 8px; }
.pf-btn {
    padding: 8px 20px; border: 2px solid #e0e0e0; border-radius: 8px;
    background: #fff; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.pf-btn:hover { border-color: var(--accent); }
.pf-btn.selected { border-color: var(--accent); background: #eef1ff; }

.info-block {
    background: #f0f4ff; border-left: 3px solid var(--accent);
    padding: 12px 16px; margin-bottom: 12px; border-radius: 0 8px 8px 0;
    font-size: 0.85rem; line-height: 1.6; white-space: pre-wrap;
}

.feedback-green { background: #d4edda; border-left: 3px solid #28a745; padding: 12px; border-radius: 8px; margin-top: 12px; }
.feedback-yellow { background: #fff3cd; border-left: 3px solid #ffc107; padding: 12px; border-radius: 8px; margin-top: 12px; }
.feedback-red { background: #f8d7da; border-left: 3px solid #dc3545; padding: 12px; border-radius: 8px; margin-top: 12px; }
.feedback-green p, .feedback-yellow p, .feedback-red p { font-size: 0.85rem; line-height: 1.5; margin: 0; }

.btn-report {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.btn-report:hover {
    background: #ffeeba;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: #fff;
    font-size: 0.6rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.historia-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}

.historia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.historia-task {
    font-weight: 600;
    font-size: 0.9rem;
}

.historia-date {
    font-size: 0.75rem;
    color: #888;
}

.historia-score {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.historia-manual {
    background: #e8f4fd;
    border-left: 3px solid var(--accent);
    padding: 8px 12px;
    margin-top: 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.historia-manual-label {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
}

.notif-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.notif-item strong {
    color: var(--accent);
}

.homework-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.homework-item:hover { background: #f8f9ff; }

.hw-name { font-weight: 600; font-size: 0.9rem; }
.hw-deadline { font-size: 0.75rem; color: #888; }
.hw-status {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 0.75rem; font-weight: 600; margin-top: 4px;
}
.hw-done { background: #d4edda; color: #155724; }
.hw-progress { background: #fff3cd; color: #856404; }
.hw-overdue { background: #f8d7da; color: #721c24; }
.hw-todo { background: #e2e3e5; color: #383d41; }

/* Star rating */
.rating-stars {
    display: flex;
    justify-content: center;
    gap: 6px;
}
.rating-stars .star {
    font-size: 2rem;
    color: #ccc;
    cursor: pointer;
    transition: color 0.15s, transform 0.1s;
    user-select: none;
}
.rating-stars .star.hover,
.rating-stars .star.active {
    color: #f5a623;
    transform: scale(1.15);
}

@media (max-width: 600px) {
    .container { padding: 16px 10px; }
    h1 { font-size: 1.3rem; margin-bottom: 16px; }
    .logo { max-width: 140px; }
    .step { padding: 14px; }
    .przedmiot-grid { flex-direction: column; }
    .przedmiot-btn, .poziom-btn { min-width: 100%; padding: 16px 14px; font-size: 0.9rem; }
    .abcd-grid { flex-direction: column; }
    .abcd-btn { min-width: 100%; padding: 12px 14px; }
    .pf-btns { gap: 6px; }
    .pf-btn { padding: 8px 16px; }
    .btn { padding: 10px 16px; font-size: 0.9rem; }
    .upload-area { padding: 28px 14px; }
    .tresc-box { padding: 12px; }
    .info-block { padding: 10px 12px; font-size: 0.8rem; }
    .wynik-header { padding: 12px; }
    .wynik-punkty { font-size: 1.1rem; }
    select { font-size: 0.9rem; padding: 8px 10px; }
    textarea { font-size: 0.85rem; padding: 10px; }
    .btn-menu-toggle { top: 10px; right: 10px; padding: 6px 10px; }
    .menu-dropdown { top: 48px; right: 10px; }
    .czat-panel {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 8px;
        max-height: 70vh;
    }
    .czat-toggle { padding: 10px 18px; font-size: 0.85rem; bottom: 16px; right: 16px; }
    .tutorial-box { padding: 20px 16px; }
    .przedmiot-header { margin-bottom: 10px; }
    .aktualny-przedmiot { font-size: 0.85rem; }
    .footer { padding: 20px 12px 12px; }
}
