/* Sora (SIL OFL 1.1, fonts/LICENSE-Sora.txt) — jedna czcionka w całym MaturaTrackerze, trzymana u nas */
@font-face { font-family: 'Sora'; font-style: normal; font-display: swap; font-weight: 100 800; src: url(../fonts/sora-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Sora'; font-style: normal; font-display: swap; font-weight: 100 800; src: url(../fonts/sora-latin.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
/*
 * MaturaTracker — style
 * Styl "Graphite" przeniesiony 1:1 z osobistego trackera (tylko reguły używane przez To-Do i Formę).
 * Nowe elementy (toast, pusty stan) są na samym dole pliku.
 */

:root {
    --bg-body: #0d0d0f;
    --bg-subtle: #131316;
    --bg-surface: rgba(26, 26, 31, 0.85);
    --bg-surface-solid: #1a1a1f;
    --bg-surface-hover: #252530;
    --bg-elevated: #1e1e25;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --accent-primary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --accent-glow: rgba(139, 92, 246, 0.25);
    --accent-subtle: rgba(139, 92, 246, 0.08);
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.3);
    --accent-green: #10b981;
    --text-main: #ededf0;
    --text-muted: #6b6b78;
    --text-secondary: #9494a0;
    --font-family: "Sora", system-ui, sans-serif;
    --radius-md: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.03);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 1px rgba(139, 92, 246, 0.15);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.12);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgba(26, 26, 31, 0.65);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-blur: blur(12px);
    --form-bad: #ef4444;
    --form-avg: #f59e0b;
    --form-good: #eab308;
    --form-excel: #22c55e;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
                radial-gradient(circle at 50% 0%, #141418 0%, #0d0d0f 70%);
    min-height: 100vh;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

@keyframes fadeIn { from {
                opacity: 0;
                transform: translateY(8px) scale(0.99);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            } }

@keyframes shimmeringGradient { 0% {
                background-position: 0% 50%;
                filter: brightness(100%);
            }

            50% {
                background-position: 100% 50%;
                filter: brightness(120%);
                box-shadow: 0 0 16px var(--accent-glow);
            }

            100% {
                background-position: 0% 50%;
                filter: brightness(100%);
            } }

#main-header {
    background-color: rgba(13, 13, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10001;
    box-shadow: 0 1px 0 rgba(139, 92, 246, 0.06), 0 4px 24px rgba(0, 0, 0, 0.3);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

nav.tabs {
    display: flex;
    gap: 4px;
    background: rgba(19, 19, 22, 0.7);
    padding: 3px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.tab {
    padding: 7px 14px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 9px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.04);
}

.tab.active {
    background-color: rgba(139, 92, 246, 0.12);
    color: var(--text-main);
    font-weight: 600;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.08);
}

.header-form {
    display: none;
    gap: 10px;
}

.header-form.active {
    display: flex;
}

.add-item-input {
    background-color: rgba(13, 13, 15, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
    width: 250px;
}

.add-item-input:focus {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.add-item-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    background-size: 200% 200%;
    animation: shimmeringGradient 5s ease infinite;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.add-item-btn:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
    animation-duration: 2s;
}

.content-panel {
    display: none;
    padding: 20px 30px;
    animation: fadeIn 0.3s ease;
}

.content-panel.active {
    display: block;
}

#tracker-panel {
    display: none;
    flex-direction: row;
    gap: 24px;
    align-items: flex-start;
    min-height: calc(100vh - 100px);
    overflow-x: auto;
    padding: 10px 10px 40px 10px;
}

#tracker-panel.active {
    display: flex;
}

.subject-column {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    width: 340px;
    flex-shrink: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-card);
    border-left: 4px solid transparent;
    transition: var(--transition);
}

.subject-column:hover {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-hover);
}

.draggable {
    cursor: grab;
}

.draggable:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.4;
    background: var(--bg-surface-hover);
    border: 1px dashed var(--text-muted);
}

.sortable-drag {
    opacity: 1;
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
    z-index: 1000;
}

.topic-card {
    background-color: rgba(30, 30, 37, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: var(--transition);
    border-left: 4px solid transparent;
    position: relative;
}

.topic-card:hover {
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover), var(--shadow-glow);
    background-color: rgba(37, 37, 48, 0.7);
}

.title-editable {
    cursor: text;
    transition: color 0.2s;
    outline: none;
    border-radius: 4px;
}

.title-editable:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.title-editable:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

.column-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.topic-header h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
    margin: 0;
}

.task-count {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-left: 8px;
    font-weight: 500;
    opacity: 0.7;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    min-width: 0;
}

.column-header,
.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.item-controls {
    display: flex;
    align-items: center;
}

.options-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.options-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.progress-container {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    height: 8px;
    margin-bottom: 14px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px var(--accent-glow);
}

.task-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 10px;
}

.task-item {
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    font-size: 0.87rem;
    transition: var(--transition);
}

.task-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.03);
}

.task-item.completed label {
    text-decoration: line-through;
    color: #8a8a96;
    opacity: 0.85;
}

.task-item.completed {
    background-color: rgba(0, 0, 0, 0.2);
    opacity: 0.85;
}

.task-item input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    margin-right: 12px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.task-item input[type="checkbox"]:hover {
    border-color: rgba(139, 92, 246, 0.5);
}

.task-item input[type="checkbox"]:checked {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* każdy zrobiony ptaszek ma swój delikatny odcień (zmienne ustawia js/todo.js) */
.task-item.completed input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--tick-a, #6366f1), var(--tick-b, #a855f7));
    border-color: var(--tick-b, var(--accent-primary));
}

.task-item input[type="checkbox"]:checked::after {
    content: "✔";
    position: absolute;
    font-size: 11px;
    color: white;
    top: -1px;
    left: 2px;
}

.task-item label {
    flex-grow: 1;
    word-break: break-word;
    color: var(--text-main);
    font-weight: 400;
}

.add-item-form {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.add-item-form-row {
    display: flex;
    gap: 8px;
}

.add-item-form .add-item-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
}

.add-item-form .add-item-btn {
    width: auto;
    padding: 8px 12px;
    font-size: 1.2rem;
    line-height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.options-menu {
    position: absolute;
    background-color: var(--bg-surface-solid);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: none;
    width: 190px;
    padding: 6px;
    animation: fadeIn 0.15s ease;
}

.options-menu.active {
    display: block;
}

.menu-section {
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
}

.menu-section:last-child {
    border-bottom: none;
}

.menu-item {
    background: none;
    border: none;
    color: var(--text-main);
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.1s;
}

.menu-item:hover {
    background-color: var(--bg-surface-hover);
}

.task-import-textarea {
    min-height: 260px;
    resize: vertical;
    line-height: 1.45;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.9rem;
}

.task-import-hint {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: -4px 0 12px;
}

.color-input {
    visibility: hidden;
    width: 0;
    height: 0;
    padding: 0;
}

/* ===== Widget Formy (od 21.10.2026): biret, poziom, segmenty, misja dnia ===== */
.form-tracker-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1500;
    width: 400px;
    box-sizing: border-box;
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 16px 16px 12px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.4s ease;
}

.ft-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ft-mascot {
    width: 92px;
    height: 80px;
    flex: none;
}

.ft-mascot .biret,
.ft-restore-mascot .biret {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.ft-mascot.hop {
    animation: ftHop 0.6s ease-out;
}

.ft-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ft-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ft-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.ft-badge {
    padding: 1px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--font-family);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.ft-numbers {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.ft-score-val {
    font-family: var(--font-family);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.ft-delta {
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.ft-delta.up {
    color: #4ade80;
}

.ft-delta.down {
    color: #f87171;
}

.ft-pop {
    position: absolute;
    left: 4px;
    top: -20px;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 700;
    color: #fde68a;
    opacity: 0;
    pointer-events: none;
}

.ft-pop.show {
    animation: ftPop 1.5s ease-out forwards;
}

.ft-segments {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
}

.ft-seg {
    height: 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.ft-seg-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ft-seg.active {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* forma 3.00: cały pasek złoty */
.ft-segments.max .ft-seg-fill {
    background: linear-gradient(90deg, #fbbf24, #fde68a) !important;
}

.ft-status-text {
    min-width: 0;
    overflow: hidden;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ft-trend {
    flex: none;
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.ft-mission {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.3s, border-color 0.3s;
}

.ft-mission.done {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.35);
}

.ft-mission-icon {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: #a78bfa;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ft-mission.done .ft-mission-icon {
    stroke: #fbbf24;
}

.ft-mission-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ft-mission-title {
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.ft-mission.done .ft-mission-title {
    color: #fde68a;
}

.ft-hint {
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--text-secondary);
}

.ft-stars {
    display: flex;
    gap: 3px;
    flex: none;
}

.ft-star svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #4a4a57;
    stroke-width: 1.6;
    stroke-linejoin: round;
}

.ft-star.on svg {
    fill: #fbbf24;
    stroke: #f59e0b;
}

.ft-star.new svg {
    animation: ftStar 0.7s ease-out;
}

@keyframes ftStar {
    0% { transform: scale(0.4) rotate(-30deg); }
    55% { transform: scale(1.35) rotate(8deg); }
    100% { transform: none; }
}

.ft-stars-count {
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fbbf24;
}

/* „Awans!” i „Misja wykonana!” — tylko przy nowym poziomie albo wykonanej misji */
.ft-banner {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translate(-50%, 0);
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, #8b5cf6, #f97316);
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.35);
    opacity: 0;
    pointer-events: none;
}

.ft-banner.show {
    animation: ftBanner 2.8s ease-out forwards;
}

.ft-close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--form-bad);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s;
}

.ft-close-btn:hover {
    transform: scale(1.1);
}

/* po zamknięciu: biret w aktualnym wyglądzie + forma */
.restore-form-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1400;
    display: none;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 14px 0 8px;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.restore-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.35), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.ft-restore-mascot {
    width: 40px;
    height: 35px;
}

.ft-restore-score {
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

@keyframes ftPop {
    0% { opacity: 0; transform: translateY(8px) scale(0.7); }
    18% { opacity: 1; transform: translateY(0) scale(1.15); }
    70% { opacity: 1; transform: translateY(-8px) scale(1); }
    100% { opacity: 0; transform: translateY(-22px) scale(1); }
}

@keyframes ftHop {
    0% { transform: translateY(0); }
    30% { transform: translateY(-10px) rotate(-5deg); }
    60% { transform: translateY(0) rotate(3deg); }
    80% { transform: translateY(-3px); }
    100% { transform: none; }
}

@keyframes ftBanner {
    0% { opacity: 0; transform: translate(-50%, 10px) scale(0.9); }
    12% { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
    20% { transform: translate(-50%, 0) scale(1); }
    82% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -6px); }
}

@keyframes ftFade {
    0% { opacity: 0; }
    10% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* „Ogranicz ruch” w systemie: bez skakania, nagroda tylko jako krótkie pojawienie się */
@media (prefers-reduced-motion: reduce) {
    .ft-mascot.hop,
    .ft-star.new svg {
        animation: none;
    }

    .ft-pop.show,
    .ft-banner.show {
        animation-name: ftFade;
    }

    .ft-seg-fill {
        transition: none;
    }
}

.modal-cancel-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.modal-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.modal-confirm-btn {
    background: linear-gradient(135deg, #059669, #10b981);
    border: none;
    color: white;
    padding: 8px 18px;
    border-radius: var(--radius-xs);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.modal-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    z-index: 5000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-surface-solid);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 28px;
    width: 380px;
    max-width: 90%;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.modal-content h3 {
    margin: 0 0 18px 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

.modal-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(13, 13, 15, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-xs);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.modal-input:focus {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.modal-btns {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

:root {
    --bg-body: #0b0b0e;
    --bg-subtle: #111115;
    --bg-surface: #15151a;
    --bg-surface-solid: #16161b;
    --bg-surface-hover: #1e1e25;
    --bg-elevated: #1a1a21;
    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.13);
    --text-main: #ececf1;
    --text-secondary: #a3a3b0;
    --text-muted: #85859a;
    --accent-strong: #7c3aed;
    --accent-soft: rgba(139, 92, 246, 0.14);
    --glass-bg: #141419;
    --glass-border: rgba(255, 255, 255, 0.06);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 0 1px rgba(139, 92, 246, 0.16);
    --radius-md: 14px;
    --radius-sm: 10px;
}

body {
    background-image: radial-gradient(ellipse 70% 40% at 50% -8%, rgba(124, 58, 237, 0.07) 0%, transparent 60%);
    -webkit-font-smoothing: antialiased;
}

#main-header {
    padding: 10px 20px;
    gap: 16px;
    background: rgba(11, 11, 14, 0.85);
    border-bottom: 1px solid var(--border-color);
    box-shadow: none;
}

.logo-container {
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.logo-mark {
    display: block;
    flex-shrink: 0;
    width: auto;
    height: 22px;
}

.logo {
    flex-shrink: 0;
    font-size: 1.1rem;
}

nav.tabs {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 2px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-color);
}

nav.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.tab[hidden] {
    display: none !important;
}

.tab-ico {
    font-size: 0.95em;
    opacity: 0.75;
    filter: saturate(0.8);
    transition: opacity 0.2s, filter 0.2s;
}

.tab:hover {
    color: var(--text-main);
}

.tab:hover .tab-ico {
    opacity: 1;
}

.tab.active {
    background: var(--accent-soft);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.35);
}

.tab.active .tab-ico {
    opacity: 1;
    filter: none;
}

.section-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding: 20px 30px 8px;
}

.section-bar[hidden] {
    display: none !important;
}

.section-bar.no-title {
    justify-content: flex-end;
    padding-top: 14px;
    padding-bottom: 0;
}

.section-bar-left {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 14px;
    min-width: 0;
}

.section-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.section-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.section-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-form {
    align-items: center;
    gap: 8px;
}

.add-item-input {
    width: 220px;
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-color);
    border-radius: 9px;
}

.add-item-btn {
    animation: none !important;
}

.add-item-btn {
    background: var(--accent-strong);
    box-shadow: none;
    padding: 8px 14px;
    border-radius: 9px;
}

.add-item-btn:hover {
    background: var(--accent-primary);
    transform: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.add-item-btn:disabled {
    opacity: 0.45;
    cursor: default;
    box-shadow: none;
    background: var(--accent-strong);
}

#tracker-panel {
    padding: 12px 30px 40px;
    gap: 18px;
    min-height: calc(100vh - 150px);
}

.subject-column {
    width: 320px;
    padding: 14px;
    gap: 10px;
    background: var(--glass-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--glass-border);
    border-left: 3px solid transparent;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
}

.subject-column:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card);
}

.column-header {
    margin-bottom: 2px;
    padding: 2px 2px 10px;
    border-bottom: 1px solid var(--border-color);
}

.column-header h2 {
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.topic-card {
    background: #1a1a20;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border-color);
    border-left: 3px solid transparent;
    border-radius: 12px;
    padding: 14px;
}

.topic-card:hover {
    transform: translateY(-1px);
    background: #1f1f26;
    border-color: var(--border-hover);
    box-shadow: var(--shadow-hover);
}

.topic-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}

.progress-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
}

.progress-bar {
    box-shadow: none;
}

/* termin zadania: mały znacznik przy nazwie */
.task-item .header-content {
    flex-wrap: wrap;
    row-gap: 4px;
}

.task-due {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px 1px 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
}

.task-due svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.task-due.soon {
    background: rgba(236, 72, 153, 0.12);
    color: #f9a8d4;
}

.task-due.today {
    background: rgba(251, 191, 36, 0.14);
    color: #fcd34d;
}

.task-due.late {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
}

.task-due.done {
    opacity: 0.7;
}

.due-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -6px 0 14px;
}

/* nagroda za zamknięty temat: krótki błysk karty i iskierki od procentu */
.topic-card.celebrate {
    animation: topicClosed 1.2s ease-out;
}

@keyframes topicClosed {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
    25% { box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.55), 0 0 28px rgba(74, 222, 128, 0.35); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.topic-card.celebrate .progress-pct {
    animation: pctPop 0.7s ease-out;
}

@keyframes pctPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.45); }
    100% { transform: scale(1); }
}

.todo-spark {
    position: absolute;
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
    border-radius: 2px;
    pointer-events: none;
    animation: todoSpark 0.9s ease-out forwards;
}

@keyframes todoSpark {
    0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(160deg) scale(0.5); }
}

@media (prefers-reduced-motion: reduce) {
    .topic-card.celebrate,
    .topic-card.celebrate .progress-pct {
        animation: none;
    }
}

/* zwijane zrobione zadania pod „Zrobione (N)” */
.done-toggle {
    list-style: none;
}

/* Podtematy w temacie (np. Funkcje › Funkcja kwadratowa): nagłówek grupy + wcięte zadania */
.sub-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    margin-top: 4px;
    padding: 2px 2px 2px 10px;
    border-left: 2px solid rgba(167, 139, 250, 0.55);
    list-style: none;
}
.task-list.has-subs > .sub-head:first-child { margin-top: 0; }
.sub-head.full { border-left-color: rgba(74, 222, 128, 0.7); }
.sub-name {
    flex: 1;
    min-width: 0;
    padding: 2px 4px;
    color: var(--text-main);
    font-size: 0.86rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.sub-count { flex: none; color: var(--text-muted); font-size: 0.74rem; }
.sub-add {
    flex: none;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
}
.sub-add:hover, .sub-add:focus-visible { background: rgba(139, 92, 246, 0.16); color: #c4b5fd; }
.sub-head .options-btn { flex: none; }
.task-item.in-sub { margin-left: 12px; }
.sub-add-row { margin-left: 12px; list-style: none; }
.sub-add-row .sub-task-input { width: 100%; margin: 0; }

.done-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
}

.done-toggle-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
}

.done-chevron {
    display: inline-block;
    width: 12px;
    font-size: 1rem;
    line-height: 1;
    text-align: center;
    transition: transform 0.15s;
}

.done-toggle-btn[aria-expanded="true"] .done-chevron {
    transform: rotate(90deg);
}

/* pasek postępu tematu + procent obok */
.progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.progress-row .progress-container {
    flex: 1 1 auto;
    margin-bottom: 0;
}

.progress-pct {
    flex: 0 0 auto;
    min-width: 3.2em;
    text-align: right;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

.progress-row.full .progress-bar {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.progress-row.full .progress-pct,
.list-pct.full {
    color: #4ade80;
}

.list-pct {
    font-variant-numeric: tabular-nums;
}

.topic-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 8px;
    padding-left: 0;
    margin: 0;
}

@media (max-width: 760px) {
    #main-header {
        padding: 8px 12px;
    }

    .logo {
        display: none;
    }

    .logo-mark {
        height: 18px;
    }

    .section-bar {
        padding: 14px 16px 4px;
    }

    .header-form {
        flex-wrap: wrap;
    }

    .add-item-input {
        width: 100%;
    }

    #tracker-panel {
        padding: 12px 16px 40px;
    }
}

/* ===== Nowe w MaturaTracker ===== */

/* Pusty stan zakładki To-Do */
.empty-state {
    max-width: 420px;
    margin: 48px auto;
    padding: 28px 24px;
    text-align: center;
    color: var(--text-secondary);
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius-md);
}

.empty-state strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text-main);
    font-size: 1.05rem;
}

/* Krótkie powiadomienia zamiast okienek alert() */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px);
    box-sizing: border-box;
    width: max-content;
    max-width: min(440px, calc(100vw - 32px));
    padding: 12px 16px;
    background: var(--bg-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 3000;
}

.toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* komunikat z przyciskiem (np. „Cofnij” po usunięciu) */
.toast.has-action {
    display: flex;
    align-items: center;
    gap: 14px;
}

.toast.has-action.visible {
    pointer-events: auto;
}

.toast-action {
    flex: none;
    padding: 6px 10px;
    border: 0;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.16);
    color: #c4b5fd;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.toast-action:hover {
    background: rgba(139, 92, 246, 0.28);
    color: #ede9fe;
}

/* każdy komunikat ma czerwone ✕ w rogu, jak widżet Formy */
.toast {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: min(720px, calc(100vw - 32px));
    overflow: visible;
}

.toast.visible {
    pointer-events: auto;
}

.toast-msg {
    flex: 1;
    min-width: 0;
}

.toast-close {
    position: absolute;
    top: -9px;
    right: -9px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--form-bad);
    color: #fff;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
}

.toast-close:hover,
.toast-close:focus-visible {
    transform: scale(1.12);
}

/* na telefonie komunikat stoi nad paskiem Formy */
@media (max-width: 760px) {
    .toast {
        bottom: 164px;
    }
}

/* ===== Tryb testowy (?test=1) ===== */
.test-badge {
    margin-left: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: #fbbf24;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.test-panel {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 312px;
    padding: 14px 16px;
    background: var(--glass-bg);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    z-index: 1500;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.test-panel .tp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-main);
}

.test-panel .tp-toggle {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.test-panel.collapsed .tp-body {
    display: none;
}

.test-panel .tp-day {
    margin: 10px 0 8px;
}

.test-panel .tp-day b {
    color: var(--text-main);
}

.test-panel .tp-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.test-panel .tp-btns button {
    padding: 6px 10px;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-xs);
    background: var(--bg-elevated);
    color: var(--text-main);
    font: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.test-panel .tp-btns button:hover {
    border-color: var(--accent-primary);
}

.test-panel .tp-btns button.tp-danger {
    color: #f87171;
}

.test-panel .tp-chart-label {
    margin: 14px 0 4px;
    color: var(--text-main);
}

.test-panel .tp-chart-label span {
    color: var(--text-muted);
}

.test-panel .tp-chart {
    margin-bottom: 10px;
}

.test-panel .tp-axis {
    fill: var(--text-muted);
    font-size: 9px;
}

.test-panel .tp-hint {
    margin: 10px 0 0;
    font-size: 0.7rem;
    color: var(--text-muted);
}

@media (max-width: 760px) {
    .test-panel {
        left: 8px;
        right: 8px;
        top: 60px;
        bottom: auto;
        width: auto;
    }
}

/* ===== Zakładka Arkusze ===== */
#arkusze-panel {
    padding: 12px 30px 150px;
}

.ark-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
    gap: 18px;
    align-items: start;
}

.ark-card {
    padding: 18px 18px 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
}

.ark-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.ark-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.ark-title h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.ark-level {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #c4b5fd;
    font-size: 0.72rem;
    font-weight: 500;
}

.ark-card-actions {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.ark-ghost-btn {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.ark-ghost-btn:hover {
    border-color: rgba(139, 92, 246, 0.6);
    color: var(--text-main);
}

.ark-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 14px 0 6px;
}

.ark-big {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.ark-stats-text p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.ark-muted {
    color: var(--text-muted);
}

.ark-stats-text .ark-muted {
    margin-top: 2px;
}

.ark-delta {
    font-weight: 600;
    color: var(--text-main);
}

.ark-delta.up {
    color: var(--form-excel);
}

.ark-delta.down {
    color: #f87171;
}

.ark-repeat {
    margin: 8px 0 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.08);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.ark-repeat b {
    color: var(--text-main);
}

.ark-chart {
    position: relative;
    margin: 10px -4px 4px;
}

.ark-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.ark-grid {
    stroke: rgba(255, 255, 255, 0.07);
    stroke-width: 1;
}

.ark-axis {
    fill: var(--text-muted);
    font-size: 10px;
    font-family: var(--font-family);
}

.ark-goal {
    stroke: #fbbf24;
    stroke-opacity: 0.55;
    stroke-width: 1;
}

.ark-goal-label {
    fill: var(--text-secondary);
    font-size: 10px;
    font-family: var(--font-family);
}

.ark-area {
    fill: #8b5cf6;
    fill-opacity: 0.1;
}

.ark-line {
    fill: none;
    stroke: #8b5cf6;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.ark-dot {
    fill: #8b5cf6;
    stroke: #141419;
    stroke-width: 2;
    pointer-events: none;
}

.ark-hit {
    fill: transparent;
    cursor: pointer;
    outline: none;
}

.ark-hit:focus-visible {
    stroke: #c4b5fd;
    stroke-width: 2;
}

.ark-end {
    fill: var(--text-main);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-family);
}

.ark-tip {
    position: absolute;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 240px;
    padding: 8px 10px;
    border: 1px solid var(--border-hover);
    border-radius: 10px;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-hover);
    font-size: 0.78rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.ark-tip strong {
    color: var(--text-main);
    font-size: 0.85rem;
}

.ark-tip[hidden] {
    display: none;
}

.ark-entries {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    border-top: 1px solid var(--border-color);
}

.ark-entry {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto 42px auto;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.ark-entry-date {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.ark-entry-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-main);
}

.ark-note-dot {
    color: var(--accent-primary);
}

.ark-entry-score,
.ark-entry-pct {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.ark-entry-pct {
    color: var(--text-main);
    font-weight: 600;
}

.ark-entry-actions {
    display: flex;
    gap: 2px;
    opacity: 0.45;
    transition: opacity 0.2s;
}

.ark-entry:hover .ark-entry-actions,
.ark-entry-actions:focus-within {
    opacity: 1;
}

.ark-icon-btn {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.ark-icon-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-main);
}

.ark-more {
    margin-top: 8px;
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--accent-primary);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.ark-empty div {
    margin-top: 16px;
}

/* okno dodawania wyniku */
.ark-modal {
    width: 460px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.ark-field {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
}

.ark-field[hidden] {
    display: none;
}

.ark-field > span,
.ark-field legend {
    display: block;
    margin-bottom: 6px;
    padding: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ark-field em {
    font-style: normal;
    color: var(--text-muted);
}

.ark-field select.modal-input {
    appearance: auto;
}

.ark-field textarea.modal-input {
    resize: vertical;
    min-height: 56px;
    font-family: inherit;
}

.ark-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 16px;
}

.ark-levels legend {
    width: 100%;
}

.ark-levels label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
}

.ark-levels input {
    accent-color: var(--accent-strong);
}

.ark-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.ark-points {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.ark-points span {
    padding-top: 9px;
    color: var(--text-muted);
}

.ark-points .modal-input {
    min-width: 0;
}

.ark-error {
    min-height: 1.2em;
    margin: -4px 0 12px;
    font-size: 0.82rem;
    color: #f87171;
}

@media (max-width: 760px) {
    #arkusze-panel {
        padding: 12px 16px 150px;
    }

    .ark-card-head {
        flex-direction: column;
    }

    .ark-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }
}

/* Widget Formy na telefonie: pasek na dole ekranu */
@media (max-width: 760px) {
    .form-tracker-widget {
        left: 8px;
        right: 8px;
        bottom: 8px;
        width: auto;
        padding: 10px 12px;
        gap: 9px;
        border-radius: 18px;
    }

    .ft-main {
        gap: 12px;
    }

    .ft-mascot {
        width: 60px;
        height: 52px;
    }

    .ft-info {
        gap: 5px;
    }

    .ft-section-label {
        display: none;
    }

    .ft-head {
        position: absolute;
        top: 10px;
        right: 14px;
    }

    .ft-score-val {
        font-size: 1.6rem;
    }

    /* w tym miejscu na telefonie stoi plakietka poziomu; postęp dnia widać w misji */
    .ft-trend {
        display: none;
    }

    .ft-mission {
        padding: 6px 10px;
    }

    .ft-mission-icon {
        display: none;
    }

    .ft-close-btn {
        top: -8px;
        right: -4px;
        width: 22px;
        height: 22px;
    }

    .restore-form-btn {
        bottom: 12px;
        right: 12px;
    }

    #tracker-panel {
        padding-bottom: 190px;
    }

    #arkusze-panel {
        padding-bottom: 190px;
    }
}

/* ===== Odliczanie do matury (nagłówek) ===== */
.countdown-pill {
    margin-left: 12px;
    padding: 5px 12px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.08);
    color: #fcd34d;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.countdown-pill:hover {
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(251, 191, 36, 0.6);
}

.countdown-pill.goal {
    border-color: rgba(20, 184, 166, 0.4);
    background: rgba(20, 184, 166, 0.08);
    color: #5eead4;
}

.countdown-pill.goal:hover {
    background: rgba(20, 184, 166, 0.14);
    border-color: rgba(20, 184, 166, 0.65);
}

.countdown-pill[hidden] {
    display: none;
}

.countdown-pill .cd-short {
    display: none;
}

/* ===== Zakładka Kalendarz ===== */
#kalendarz-panel {
    padding: 12px 30px 150px;
}

.kal-muted {
    color: var(--text-muted);
}

.kal-countdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.kal-counts,
.kal-cd-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.kal-count {
    flex: 0 0 auto;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s;
    padding: 5px 10px;
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.06);
    color: var(--text-secondary);
}

.kal-count:hover {
    border-color: rgba(251, 191, 36, 0.55);
}

.kal-count.goal:hover {
    border-color: rgba(20, 184, 166, 0.6);
}

.kal-count b {
    color: var(--text-main);
    font-weight: 600;
}

.kal-count.goal {
    border-color: rgba(20, 184, 166, 0.3);
    background: rgba(20, 184, 166, 0.07);
}

.kal-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.kal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kal-month {
    min-width: 190px;
    margin: 0;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    text-transform: capitalize;
    color: var(--text-main);
}

.kal-icon-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-main);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.kal-icon-btn:hover,
.kal-small-btn:hover {
    border-color: rgba(139, 92, 246, 0.6);
}

.kal-small-btn {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

.kal-small-btn.accent {
    border-color: rgba(139, 92, 246, 0.5);
    color: #c4b5fd;
}

.kal-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.kal-legend span,
.kal-legend label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.kal-legend label {
    cursor: pointer;
}

.kal-legend input {
    accent-color: var(--accent-strong);
}

.kal-legend i,
.kal-dots i {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* kolory rodzajów wpisów */
.kal-legend i.probna, .kal-dots i.probna { background: #8b5cf6; }
.kal-legend i.sprawdzian, .kal-dots i.sprawdzian { background: #3b82f6; }
.kal-legend i.inne, .kal-dots i.inne { background: #71717a; }
.kal-legend i.matura, .kal-dots i.matura { background: #fbbf24; }
.kal-legend i.cel, .kal-dots i.cel { background: #14b8a6; }
.kal-legend i.zadanie, .kal-dots i.zadanie { background: #ec4899; }
.kal-dots i.zadanie.done { background: transparent; box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.6); }
.kal-legend i.holiday { border-radius: 3px; background: rgba(244, 63, 94, 0.35); }

.kal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: var(--glass-bg);
}

.kal-dow {
    padding: 4px 8px 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}

.kal-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 104px;
    min-width: 0;
    padding: 6px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.kal-cell:hover {
    border-color: var(--border-hover);
}

.kal-cell:focus-visible {
    border-color: #c4b5fd;
}

.kal-cell.out {
    opacity: 0.38;
}

/* dni ustawowo wolne: inny odcień i mały, blady podpis */
.kal-cell.holiday {
    background: rgba(244, 63, 94, 0.06);
}

.kal-cell.holiday .kal-num {
    color: #fda4af;
}

.kal-holiday {
    overflow: hidden;
    margin-top: -3px;
    font-size: 0.62rem;
    line-height: 1.2;
    color: rgba(253, 164, 175, 0.55);
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* blady podpis na dole pola: ile zrobiono tego dnia (jaśniejszy przy większej aktywności) */
.kal-done {
    margin-top: auto;
    overflow: hidden;
    font-size: 0.66rem;
    line-height: 1.2;
    color: #c4b5fd;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0.4;
}

.kal-done.lvl-2 { opacity: 0.55; }
.kal-done.lvl-3 { opacity: 0.7; }

/* aktywność minionych dni */
.kal-cell.act-1 { background: rgba(139, 92, 246, 0.07); }
.kal-cell.act-2 { background: rgba(139, 92, 246, 0.13); }
.kal-cell.act-3 { background: rgba(139, 92, 246, 0.2); }

.kal-cell.selected {
    border-color: rgba(139, 92, 246, 0.55);
}

.kal-num {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.kal-cell.today .kal-num {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-strong);
    color: #fff;
}

.kal-chips {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.kal-chip {
    overflow: hidden;
    padding: 2px 6px;
    border-left: 3px solid #71717a;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 0.72rem;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.kal-chip b {
    font-weight: 600;
    color: var(--text-secondary);
}

.kal-chip[data-event]:hover {
    background: rgba(255, 255, 255, 0.1);
}

.kal-chip.probna { border-left-color: #8b5cf6; background: rgba(139, 92, 246, 0.14); }
.kal-chip.sprawdzian { border-left-color: #3b82f6; background: rgba(59, 130, 246, 0.13); }
.kal-chip.matura { border-left-color: #fbbf24; background: rgba(251, 191, 36, 0.12); color: #fde68a; }
.kal-chip.cel { border-left-color: #14b8a6; background: rgba(20, 184, 166, 0.12); color: #99f6e4; }
.kal-chip.zadanie { border-left-color: #ec4899; background: rgba(236, 72, 153, 0.12); color: #fbcfe8; }
.kal-chip.zadanie.done { opacity: 0.5; text-decoration: line-through; }

/* matura, której uczeń nie zdaje: blady obrys bez wypełnienia, nie konkuruje z wpisami */
.kal-chip.matura.off {
    padding: 1px 6px;
    border: 1px dashed rgba(251, 191, 36, 0.22);
    border-left-width: 1px;
    background: transparent;
    color: rgba(253, 230, 138, 0.38);
    font-size: 0.66rem;
}

.kal-dots i.matura.off {
    background: transparent;
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.45);
}

.kal-more {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.kal-dots {
    display: none;
    gap: 3px;
}

.kal-hint {
    margin: 8px 2px 18px;
    font-size: 0.75rem;
}

/* panel wybranego dnia */
.kal-day {
    max-width: 760px;
    padding: 16px 18px;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: var(--glass-bg);
}

.kal-day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.kal-day-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.kal-today-tag {
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #c4b5fd;
    font-size: 0.7rem;
    font-weight: 500;
    vertical-align: middle;
}

.kal-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.kal-tag {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #e4e4e7;
    background: rgba(113, 113, 122, 0.3);
}

.kal-tag.probna { background: rgba(139, 92, 246, 0.25); color: #ddd6fe; }
.kal-tag.sprawdzian { background: rgba(59, 130, 246, 0.25); color: #bfdbfe; }
.kal-tag.matura { background: rgba(251, 191, 36, 0.2); color: #fde68a; }
.kal-tag.cel { background: rgba(20, 184, 166, 0.22); color: #99f6e4; }
.kal-tag.zadanie { background: rgba(236, 72, 153, 0.22); color: #fbcfe8; }
.kal-tag.holiday { background: rgba(244, 63, 94, 0.16); color: #fda4af; }

/* egzamin, którego uczeń nie zdaje (odznaczony w panelu dnia) */
.kal-item.off .kal-tag,
.kal-item.off .kal-item-text {
    opacity: 0.45;
}

.kal-item.off .kal-item-text b {
    text-decoration: line-through;
}

.kal-check {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.kal-check input {
    accent-color: var(--accent-strong);
}

.kal-item-text {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.88rem;
    color: var(--text-main);
}

.kal-item-text b {
    font-weight: 600;
}

.kal-item-text .kal-muted {
    font-size: 0.78rem;
}

.kal-item-actions {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.kal-activity {
    margin: 10px 0 0;
    font-size: 0.8rem;
}

.kal-delete {
    margin-right: auto;
    color: #f87171;
}

.kal-subjects-list {
    display: grid;
    gap: 2px;
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 16px;
}

.kal-subj {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 7px 4px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
}

.kal-subj:hover {
    background: rgba(255, 255, 255, 0.04);
}

.kal-subj input {
    accent-color: var(--accent-strong);
}

.kal-subj .kal-muted {
    font-size: 0.78rem;
}

/* okno ustawień odliczania */
.kal-switch {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 0.92rem;
    color: var(--text-main);
    cursor: pointer;
}

.kal-switch input {
    margin-top: 3px;
    accent-color: var(--accent-strong);
}

.kal-switch em {
    font-style: normal;
    color: var(--text-muted);
}

.kal-cd-body[hidden],
.kal-cd-matura[hidden] {
    display: none;
}

.kal-cd-matura {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: -6px 0 18px 26px;
    font-size: 0.8rem;
}

.kal-cd-section {
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.kal-goals {
    display: grid;
    gap: 4px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
}

.kal-goal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px;
    border-left: 3px solid #14b8a6;
    border-radius: 6px;
    background: rgba(20, 184, 166, 0.07);
    color: var(--text-main);
}

.kal-goal .kal-muted {
    font-size: 0.78rem;
}

.kal-goal-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.kal-goal-add #cd-goal-name {
    grid-column: 1 / -1;
}

.kal-goal-add .modal-input {
    margin-bottom: 0;
}

.kal-goal-add .add-item-btn {
    white-space: nowrap;
}

.kal-goal-add + .ark-error {
    margin: 6px 0 4px;
}

@media (max-width: 760px) {
    .kal-holiday,
    .kal-done {
        display: none;
    }

}

@media (max-width: 760px) {
    #kalendarz-panel {
        padding: 12px 10px 190px;
    }

    .countdown-pill {
        margin-left: 6px;
        padding: 4px 9px;
    }

    .countdown-pill .cd-long {
        display: none;
    }

    .countdown-pill .cd-short {
        display: inline;
    }

    .kal-month {
        min-width: 0;
        font-size: 1rem;
    }

    /* na telefonie terminy przewijają się w jednym rzędzie, przyciski pod spodem */
    .kal-counts {
        flex-wrap: nowrap;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .kal-counts::-webkit-scrollbar {
        display: none;
    }

    .kal-grid {
        gap: 2px;
        padding: 4px;
    }

    .kal-dow {
        padding: 2px 0 4px;
        text-align: center;
    }

    .kal-cell {
        align-items: center;
        min-height: 52px;
        padding: 5px 2px;
    }

    .kal-chips {
        display: none;
    }

    .kal-dots {
        display: flex;
    }

    .kal-item {
        flex-wrap: wrap;
    }

    /* przewijanie do panelu dnia uwzględnia pasek Formy na dole ekranu */
    .kal-day {
        scroll-margin-top: 70px;
        scroll-margin-bottom: 150px;
    }

    .kal-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Na wąskich telefonach zakładki pokazują same ikony (nazwa jest w tytule sekcji) */
@media (max-width: 480px) {
    .tab .tab-label {
        display: none;
    }

    .tab {
        padding-left: 9px;
        padding-right: 9px;
    }
}

/* ===== Zakładka Notatki ===== */
#notatki-panel {
    position: relative;
    padding: 14px 30px 150px;
}

.nt-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.nt-side {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
}

.nt-tree {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nt-tree-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.86rem;
    text-align: left;
    cursor: pointer;
}

.nt-tree-item span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nt-tree-item em {
    font-style: normal;
    font-size: 0.74rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.nt-tree-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.nt-tree-item.active {
    background: var(--accent-subtle);
    color: #ddd6fe;
}

.nt-tree-item.root {
    margin-bottom: 6px;
}

.nt-tree-item.sub {
    padding-left: 29px;
    font-size: 0.82rem;
}

.nt-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 3px;
}

.nt-storage {
    margin: 18px 10px 0;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.nt-storage-bar {
    height: 4px;
    margin-bottom: 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.nt-storage-bar i {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: 4px;
    background: var(--accent-gradient);
}

.nt-search {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 420px;
    margin-bottom: 18px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(13, 13, 15, 0.6);
    color: var(--text-muted);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.nt-search:focus-within {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.nt-search input {
    flex: 1;
    min-width: 0;
    padding: 9px 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-size: 0.9rem;
}

.nt-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.nt-crumbs button:not(.nt-more) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text-secondary);
    font: inherit;
    cursor: pointer;
}

.nt-crumbs button:not(.nt-more):hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

.nt-crumbs strong {
    padding: 4px 2px 4px 6px;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
}

.nt-sep {
    color: var(--text-muted);
}

.nt-hint,
.nt-tip {
    margin: 0 0 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.nt-tip {
    margin-top: 16px;
}

.nt-subhead {
    margin: 26px 0 12px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* foldery (przedmioty i tematy) */
.nt-folders {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}

.nt-folder {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 168px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: var(--glass-bg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.nt-folder::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--c, var(--accent-primary));
    opacity: 0.85;
}

.nt-folder:hover,
.nt-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-hover);
}

.nt-folder:focus-visible,
.nt-card:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.7);
    outline-offset: 2px;
}

.nt-folder-art {
    position: relative;
    flex: 1;
    min-height: 104px;
    background: radial-gradient(120% 90% at 50% 100%, color-mix(in srgb, var(--c, #8b5cf6) 16%, transparent), transparent 70%);
}

.nt-folder-art.empty {
    display: grid;
    place-items: center;
    color: color-mix(in srgb, var(--c, #8b5cf6) 70%, #ffffff 10%);
    opacity: 0.75;
}

.nt-folder-art img {
    position: absolute;
    left: 50%;
    bottom: -14px;
    width: 42%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 6px;
    background: #f4f4f5;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.25s;
}

.nt-folder-art img.ready {
    opacity: 1;
}

.nt-folder-art.n1 img {
    transform: translateX(-50%);
}

.nt-folder-art.n2 img:nth-child(1),
.nt-folder-art.n3 img:nth-child(1) {
    transform: translateX(-78%) rotate(-7deg);
}

.nt-folder-art.n2 img:nth-child(2),
.nt-folder-art.n3 img:nth-child(3) {
    transform: translateX(-22%) rotate(6deg);
}

.nt-folder-art.n3 img:nth-child(2) {
    z-index: 1;
    transform: translateX(-50%) translateY(-6px);
}

.nt-folder-info {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 11px 40px 12px 14px;
    background: var(--bg-surface-solid);
    border-top: 1px solid var(--border-color);
}

.nt-folder-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 600;
}

.nt-folder-info span {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.nt-more {
    position: absolute;
    right: 6px;
    bottom: 10px;
    z-index: 3;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.nt-more:hover,
.nt-more:focus-visible {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
}

.nt-more.inline {
    position: static;
    width: 28px;
    height: 28px;
}

.nt-new {
    justify-content: center;
    align-items: stretch;
    gap: 10px;
    padding: 16px;
    border-style: dashed;
    border-color: var(--border-hover);
    background: transparent;
    box-shadow: none;
    cursor: default;
}

.nt-new::before {
    display: none;
}

.nt-new:hover {
    transform: none;
    box-shadow: none;
}

.nt-new-plus {
    align-self: center;
    font-size: 1.6rem;
    font-weight: 300;
    color: var(--text-muted);
}

.nt-new-input {
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    background: rgba(13, 13, 15, 0.6);
    color: var(--text-main);
    font: inherit;
    font-size: 0.88rem;
}

.nt-new-input:focus {
    border-color: rgba(139, 92, 246, 0.4);
}

/* notatki */
.nt-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.nt-actions .kal-small-btn {
    padding: 8px 14px;
}

.nt-progress {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #c4b5fd;
}

.nt-progress i {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(196, 181, 253, 0.3);
    border-top-color: #c4b5fd;
    border-radius: 50%;
    animation: ntSpin 0.8s linear infinite;
}

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

.nt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 14px;
}

.nt-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--bg-surface-solid);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.nt-thumb {
    position: relative;
    aspect-ratio: 4 / 5;
    background: #18181d;
    overflow: hidden;
}

.nt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    opacity: 0;
    transition: opacity 0.25s;
}

.nt-thumb img.ready {
    opacity: 1;
}

.nt-thumb.pdf img {
    object-fit: contain;
    background: #fff;
}

.nt-thumb-ico {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--text-muted);
}

.nt-thumb.missing::after {
    content: "brak pliku";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nt-thumb.text {
    padding: 14px 14px 0;
    background: linear-gradient(180deg, #faf8f1, #f1ede0);
}

.nt-thumb.text p {
    margin: 0;
    color: #3f3a2e;
    font-size: 0.74rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: hidden;
    height: 100%;
    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
    mask-image: linear-gradient(180deg, #000 70%, transparent);
}

.nt-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(13, 13, 15, 0.78);
    color: #e4e4e7;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
}

.nt-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 50px;
    padding: 9px 38px 10px 11px;
}

.nt-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
}

.nt-path {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.nt-card .nt-more {
    bottom: auto;
    top: auto;
    right: 4px;
    bottom: 8px;
}

.nt-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 640px;
    padding: 46px 24px;
    border: 1.5px dashed rgba(139, 92, 246, 0.35);
    border-radius: 16px;
    background: rgba(139, 92, 246, 0.04);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.88rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.nt-dropzone:hover {
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(139, 92, 246, 0.08);
}

.nt-dropzone svg {
    color: #a78bfa;
}

.nt-dropzone strong {
    color: var(--text-main);
    font-size: 1rem;
}

.nt-dz-phone {
    display: none;
}

.nt-empty .nt-empty-ico {
    color: #a78bfa;
    margin-bottom: 8px;
}

.nt-quick {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.nt-empty-hint {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.nt-noresults {
    padding: 40px 0;
    color: var(--text-secondary);
}

.nt-noresults span {
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.nt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nt-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-surface-solid);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.nt-chip:hover {
    border-color: var(--border-hover);
    color: var(--text-main);
}

.nt-chip i {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    background: var(--c);
}

.nt-chip b {
    color: var(--text-main);
    font-weight: 600;
}

.nt-chip em {
    font-style: normal;
    color: var(--text-muted);
    font-size: 0.74rem;
}

/* przeciąganie plików */
.nt-drop {
    position: absolute;
    inset: 6px 12px;
    z-index: 50;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px dashed rgba(167, 139, 250, 0.7);
    border-radius: 18px;
    background: rgba(13, 13, 15, 0.82);
    backdrop-filter: blur(3px);
    color: #c4b5fd;
    text-align: center;
    pointer-events: none;
}

.nt-drop strong {
    color: var(--text-main);
    font-size: 1.1rem;
}

.nt-drop span {
    font-size: 0.86rem;
    color: var(--text-secondary);
}

#notatki-panel.nt-dragging .nt-drop {
    display: flex;
}

/* menu „⋯” */
.nt-menu {
    position: fixed;
    z-index: 10150;
    display: flex;
    flex-direction: column;
    min-width: 176px;
    padding: 5px;
    border: 1px solid var(--border-hover);
    border-radius: 10px;
    background: var(--bg-elevated);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.nt-menu[hidden] {
    display: none;
}

.nt-menu button {
    padding: 8px 11px;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--text-main);
    font: inherit;
    font-size: 0.86rem;
    text-align: left;
    cursor: pointer;
}

.nt-menu button:hover,
.nt-menu button:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.nt-menu button.danger {
    color: #f87171;
}

#nt-modal {
    z-index: 10100;
}

#nt-modal-form.nt-wide {
    width: 620px;
}

.nt-textarea {
    min-height: 220px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.nt-count {
    float: right;
    font-variant-numeric: tabular-nums;
}

.toast {
    z-index: 10200;
}

/* podgląd */
body.nt-noscroll {
    overflow: hidden;
}

.nt-viewer {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    background: #09090b;
    outline: none;
    animation: fadeIn 0.18s ease;
}

.nt-viewer[hidden] {
    display: none;
}

.nt-v-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(13, 13, 15, 0.9);
}

.nt-v-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nt-v-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
}

.nt-v-title > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.nt-v-count:not(:empty)::before {
    content: "· ";
}

.nt-v-tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
}

.nt-v-tools button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.86rem;
    cursor: pointer;
}

.nt-v-tools button:hover {
    border-color: rgba(139, 92, 246, 0.6);
    color: var(--text-main);
}

.nt-v-zoombox {
    display: inline-flex;
    gap: 2px;
}

#nt-v-zoom {
    min-width: 58px;
    font-variant-numeric: tabular-nums;
}

.nt-v-close {
    font-size: 1rem !important;
}

.nt-viewer[data-kind="text"] .nt-v-zoombox,
.nt-viewer[data-kind="text"] .nt-v-download,
.nt-viewer:not([data-kind="pdf"]) .nt-v-newtab,
.nt-viewer:not([data-kind="text"]) .nt-v-edit {
    display: none;
}

.nt-v-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.nt-viewer[data-kind="image"] .nt-v-stage {
    overflow: hidden;
    touch-action: none;
}

.nt-v-imgwrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 64px;
}

.nt-v-img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    transform-origin: center;
    user-select: none;
    -webkit-user-drag: none;
    cursor: zoom-in;
}

.nt-viewer.zoomed .nt-v-img {
    cursor: grab;
}

.nt-v-pdf {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: max-content;
    min-width: 100%;
    padding: 18px 12px 40px;
}

.nt-v-page {
    position: relative;
    max-width: none;
    background: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
}

.nt-v-page span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #a1a1aa;
    font-size: 0.9rem;
}

.nt-v-page canvas {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

.nt-v-text {
    max-width: 720px;
    margin: 28px auto 60px;
    padding: 32px 36px;
    border-radius: 12px;
    background: linear-gradient(180deg, #faf8f1, #f3efe3);
    color: #2f2b22;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.nt-v-text h2 {
    margin: 0 0 16px;
    font-size: 1.25rem;
}

.nt-v-body {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.65;
    font-size: 0.98rem;
}

.nt-v-msg {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: var(--text-secondary);
    text-align: center;
}

.nt-v-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 46px;
    height: 64px;
    margin-top: -32px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(26, 26, 31, 0.8);
    color: var(--text-main);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.nt-v-nav.prev {
    left: 10px;
}

.nt-v-nav.next {
    right: 10px;
}

.nt-v-nav:disabled,
.nt-viewer.single .nt-v-nav {
    display: none;
}

@media (max-width: 1000px) {
    .nt-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .nt-side {
        display: none;
    }
}

@media (max-width: 760px) {
    #notatki-panel {
        padding: 10px 14px 190px;
    }

    .nt-search {
        max-width: none;
        margin-bottom: 14px;
    }

    .nt-folders {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .nt-folder {
        min-height: 148px;
    }

    .nt-folder-art {
        min-height: 88px;
    }

    .nt-new {
        grid-column: 1 / -1;
        min-height: 0;
        flex-direction: row;
        padding: 10px;
    }

    .nt-new-input {
        flex: 1;
        min-width: 0;
    }

    .nt-new-plus {
        display: none;
    }

    .nt-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .nt-dz-desk,
    .nt-tip {
        display: none;
    }

    .nt-dz-phone {
        display: inline;
    }

    .nt-dropzone {
        padding: 36px 18px;
    }

    .nt-v-bar {
        padding: 8px 10px;
        gap: 8px;
    }

    .nt-v-tools {
        gap: 4px;
    }

    .nt-v-tools button {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
    }

    .nt-v-zoombox button:not(#nt-v-zoom) {
        display: none;
    }

    #nt-v-path {
        display: none;
    }

    .nt-v-count:not(:empty)::before {
        content: "";
    }

    #nt-v-page:not(:empty)::before {
        content: "· ";
    }

    #nt-v-count:empty + #nt-v-page::before {
        content: "";
    }

    #nt-v-zoom {
        min-width: 50px;
    }

    .nt-v-imgwrap {
        padding: 10px;
    }

    .nt-v-nav {
        top: auto;
        bottom: 14px;
        margin-top: 0;
        width: 52px;
        height: 46px;
    }

    .nt-v-text {
        margin: 12px;
        padding: 22px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nt-folder,
    .nt-card,
    .nt-progress i {
        transition: none;
        animation: none;
    }
}

/* ===== Zakładka Ucz się (centrum nauki) ===== */
.section-ico img {
    height: 0.78em;
    width: auto;
    vertical-align: -0.02em;
}

.tab.tab-ucz {
    position: relative;
    overflow: hidden;
    color: #ddd6fe;
    background: linear-gradient(120deg, rgba(139, 92, 246, 0.16), rgba(217, 70, 239, 0.08) 55%, rgba(249, 115, 22, 0.1));
    box-shadow: inset 0 0 0 1px rgba(196, 181, 253, 0.2);
}

.tab.tab-ucz .tab-ico {
    display: inline-flex;
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.45));
}

.tab.tab-ucz .tab-ico img {
    display: block;
    height: 15px;
    width: auto;
}

.tab.tab-ucz .tab-label {
    font-weight: 600;
    background: linear-gradient(90deg, #c4b5fd, #f0abfc 55%, #fdba74);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* przesuwający się błysk */
.tab.tab-ucz::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.16) 50%, transparent 65%);
    transform: translateX(-120%);
    animation: uczSheen 6s ease-in-out infinite;
    pointer-events: none;
}

.tab.tab-ucz:hover,
.tab.tab-ucz.active {
    background: linear-gradient(120deg, rgba(139, 92, 246, 0.3), rgba(217, 70, 239, 0.14) 55%, rgba(249, 115, 22, 0.16));
    box-shadow: inset 0 0 0 1px rgba(196, 181, 253, 0.45), 0 0 14px rgba(139, 92, 246, 0.25);
}

/* magiczny pyłek */
.ucz-spark {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fde68a;
    clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
    opacity: 0;
    pointer-events: none;
    animation: uczTwinkle 3.2s ease-in-out infinite;
}

.ucz-spark.s1 { top: 3px; left: 9px; animation-delay: 0s; }
.ucz-spark.s2 { bottom: 3px; left: 34%; width: 4px; height: 4px; background: #f0abfc; animation-delay: 0.7s; }
.ucz-spark.s3 { top: 4px; right: 22%; background: #c4b5fd; animation-delay: 1.5s; }
.ucz-spark.s4 { bottom: 4px; right: 7px; width: 5px; height: 5px; animation-delay: 2.2s; }
.ucz-spark.s5 { top: 46%; left: 52%; width: 3px; height: 3px; background: #ffffff; animation-delay: 2.8s; }

/* gdy coś czeka na dziś: pyłek gęstszy i jaśniejszy */
.tab.tab-ucz.has-due .ucz-spark {
    animation-duration: 2s;
}

.tab.tab-ucz.has-due {
    box-shadow: inset 0 0 0 1px rgba(253, 230, 138, 0.35), 0 0 16px rgba(245, 158, 11, 0.2);
}

@keyframes uczTwinkle {
    0%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
    35% { opacity: 1; transform: scale(1) rotate(45deg); }
    60% { opacity: 0.5; transform: scale(0.75) rotate(70deg); }
}

@keyframes uczSheen {
    0%, 70% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

#ucz-panel {
    padding: 14px 30px 150px;
}

.uc-wrap {
    max-width: 1080px;
}

.uc-section + .uc-section {
    margin-top: 30px;
}

.uc-h {
    margin: 0 0 12px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.uc-today {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.uc-today-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: var(--glass-bg);
    box-shadow: var(--shadow-card);
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.uc-today-card:hover,
.uc-tile:not(.uc-more):hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-hover);
}

.uc-today-card.due {
    border-color: color-mix(in srgb, var(--c) 45%, transparent);
    background: linear-gradient(120deg, color-mix(in srgb, var(--c) 14%, transparent), var(--glass-bg) 70%);
}

.uc-today-ico {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--c) 14%, transparent);
    color: var(--c);
}

.uc-today-ico svg {
    width: 28px;
    height: 28px;
}

.uc-today-txt {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.uc-today-txt strong {
    font-size: 0.95rem;
}

.uc-today-txt span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.uc-count {
    min-width: 26px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--c);
    color: #0b0b0e;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
}

.uc-go {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.uc-go.cta {
    padding: 6px 12px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--c) 18%, transparent);
    color: color-mix(in srgb, var(--c) 60%, #ffffff);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.uc-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.uc-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px 20px 18px;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background:
        radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--c) 13%, transparent), transparent 60%),
        var(--glass-bg);
    box-shadow: var(--shadow-card);
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.uc-tile::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--c);
    opacity: 0.85;
}

.uc-tile-ico {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 4px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--c) 14%, transparent);
    color: var(--c);
}

.uc-tile-ico svg {
    width: 36px;
    height: 36px;
}

.uc-tile-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
}

.uc-soon {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.uc-tile-desc {
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.uc-feats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.uc-feats.center {
    justify-content: center;
    margin: 14px 0 4px;
}

.uc-feats i {
    padding: 3px 9px;
    border: 1px solid color-mix(in srgb, var(--c, #8b5cf6) 30%, transparent);
    border-radius: 999px;
    color: color-mix(in srgb, var(--c, #8b5cf6) 55%, #ffffff);
    font-size: 0.72rem;
    font-style: normal;
}

.uc-more {
    --c: #6b6b78;
    justify-content: center;
    align-items: center;
    min-height: 150px;
    border-style: dashed;
    border-color: var(--border-hover);
    background: transparent;
    box-shadow: none;
    text-align: center;
    cursor: default;
}

.uc-more::before {
    display: none;
}

.uc-more .uc-tile-ico {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.04);
}

.uc-crumb-logo {
    height: 13px;
    width: auto;
}

.uc-soon-box {
    max-width: 560px;
    margin-top: 10px;
}

.uc-soon-ico {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--c) 14%, transparent);
    color: var(--c);
}

.uc-soon-ico svg {
    width: 42px;
    height: 42px;
}

.uc-soon-box > div:last-child {
    margin-top: 16px;
}

@media (max-width: 760px) {
    #ucz-panel {
        padding: 10px 14px 190px;
    }

    .uc-today,
    .uc-tiles {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .uc-tile {
        padding: 16px;
    }

    .uc-tile-ico {
        width: 46px;
        height: 46px;
    }

    .uc-tile-ico svg {
        width: 30px;
        height: 30px;
    }

    .uc-more {
        min-height: 0;
        flex-direction: row;
        padding: 12px 16px;
    }

    .uc-more .uc-tile-ico {
        margin: 0;
    }
}

@media (max-width: 480px) {
    .tab.tab-ucz {
        padding-left: 6px;
        padding-right: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tab.tab-ucz::before {
        animation: none;
        display: none;
    }

    .ucz-spark {
        animation: none;
        opacity: 0.55;
    }

    .uc-today-card,
    .uc-tile {
        transition: none;
    }
}

.uc-tile-desc strong,
.uc-soon-desc strong {
    display: inline;
    margin: 0;
    color: var(--text-main);
    font-size: inherit;
    font-weight: 600;
}

.uc-soon-desc {
    margin: 0;
    line-height: 1.55;
}

/* ===== Menu konta (trzy kreski + panel z prawej) ===== */
.menu-btn {
    flex: 0 0 auto;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 38px;
    height: 36px;
    margin-left: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.menu-btn span {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--text-secondary);
    transition: transform 0.2s, opacity 0.2s, background 0.2s;
}

.menu-btn:hover,
.menu-btn[aria-expanded="true"] {
    border-color: rgba(139, 92, 246, 0.5);
    background: var(--accent-subtle);
}

.menu-btn:hover span,
.menu-btn[aria-expanded="true"] span {
    background: var(--text-main);
}

.sm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10080;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sm-backdrop.show {
    opacity: 1;
}

.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 10090;
    display: flex;
    flex-direction: column;
    width: 340px;
    max-width: 88vw;
    padding: 14px 16px 16px;
    border-left: 1px solid var(--border-hover);
    background: linear-gradient(180deg, #16161c, #0f0f13);
    box-shadow: -24px 0 48px rgba(0, 0, 0, 0.5);
    outline: none;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-menu.show {
    transform: translateX(0);
}

.side-menu[hidden],
.sm-backdrop[hidden] {
    display: none;
}

body.sm-open {
    overflow: hidden;
}

.sm-top {
    display: flex;
    justify-content: flex-end;
}

.sm-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
}

.sm-close:hover {
    border-color: var(--border-hover);
    color: var(--text-main);
}

.sm-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 6px 0 18px;
    padding: 16px;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: radial-gradient(120% 120% at 0% 0%, rgba(139, 92, 246, 0.16), transparent 60%), var(--glass-bg);
}

.sm-avatar {
    --ring: #8b5cf6;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #2a2540, #15131f);
    box-shadow: 0 0 0 2px var(--ring), 0 0 18px color-mix(in srgb, var(--ring) 35%, transparent);
    overflow: hidden;
}

.sm-avatar {
    position: relative;
    padding: 0;
    border: 0;
    cursor: pointer;
    overflow: visible;
}

.sm-person {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    fill: #a6a2b8;
    background: #3a3746;
}

.sm-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.sm-cam {
    position: absolute;
    right: -3px;
    bottom: -3px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 2px solid #16161c;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    transition: transform 0.15s;
}

.sm-cam svg {
    width: 13px;
    height: 13px;
}

.sm-avatar:hover .sm-cam,
.sm-avatar:focus-visible .sm-cam {
    transform: scale(1.12);
}

.sm-avatar:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.7);
    outline-offset: 4px;
}

.sm-avatar-remove {
    align-self: flex-start;
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.74rem;
    text-decoration: underline;
    cursor: pointer;
}

.sm-avatar-remove:hover {
    color: #fca5a5;
}

.sm-avatar-remove[hidden] {
    display: none;
}

.sm-who {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sm-who strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.05rem;
}

.sm-who > span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.sm-forma {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: var(--text-secondary) !important;
    font-weight: 600;
}

.sm-forma i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.sm-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 10px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.sm-item:hover,
.sm-item:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    outline: none;
}

.sm-ico {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.1);
    color: #c4b5fd;
}

.sm-ico svg {
    width: 19px;
    height: 19px;
}

.sm-ico-biret svg {
    width: 30px;
    height: auto;
}

.sm-txt {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.sm-txt b {
    font-size: 0.9rem;
    font-weight: 600;
}

.sm-txt em {
    font-size: 0.74rem;
    font-style: normal;
    color: var(--text-muted);
}

.sm-bottom {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.sm-logout .sm-ico {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.sm-logout b {
    color: #fca5a5;
}

.sm-foot {
    margin: 12px 10px 0;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.sm-foot button,
.sm-foot a {
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-secondary);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.sm-foot button:hover,
.sm-foot a:hover {
    color: var(--text-main);
    text-decoration: underline;
}

@media (max-width: 760px) {
    .menu-btn {
        width: 34px;
        height: 32px;
        margin-left: 6px;
    }

    .menu-btn span {
        width: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .side-menu,
    .sm-backdrop {
        transition: none;
    }
}

/* wąskie telefony: ciaśniejszy nagłówek, żeby zmieściło się 5 zakładek, licznik i menu */
@media (max-width: 480px) {
    #main-header {
        padding: 8px;
        gap: 6px;
    }

    .logo-container {
        gap: 6px;
    }

    .countdown-pill {
        margin-left: 0;
        padding: 4px 8px;
    }

    .menu-btn {
        width: 32px;
        margin-left: 0;
    }
}

@media (max-width: 380px) {
    .logo-mark {
        display: none;
    }
}

/* tryb testowy na telefonie: sama ikonka zamiast napisu, żeby nie zabierała miejsca zakładkom */
@media (max-width: 480px) {
    .test-badge {
        padding: 2px 5px;
        font-size: 0;
    }

    .test-badge::before {
        content: "🧪";
        font-size: 0.8rem;
    }
}

/* ===== Narzędzie do wycinków ===== */
body.wy-open {
    overflow: hidden;
}

.wy {
    position: fixed;
    inset: 0;
    z-index: 10120;
    display: flex;
    flex-direction: column;
    background: #09090b;
}

.wy[hidden] {
    display: none;
}

.wy-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}

.wy-title {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.wy-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wy-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.wy-zoom {
    display: flex;
    gap: 4px;
}

.wy-zoom button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
}

.wy-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    padding: 12px;
}

.wy-wrap {
    position: relative;
    margin: auto;
    line-height: 0;
    touch-action: pinch-zoom;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
    border-radius: 4px;
}

.wy-img {
    display: block;
    max-width: none;
    height: auto;
    pointer-events: none;
    -webkit-user-drag: none;
}

.wy-rect {
    position: absolute;
    border: 2px solid #a78bfa;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    cursor: move;
}

.wy-rect[hidden] {
    display: none;
}

.wy-h {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #8b5cf6;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.wy-h::after {
    content: "";
    position: absolute;
    inset: -10px;
}

.wy-h[data-c="nw"] { left: -12px; top: -12px; cursor: nwse-resize; }
.wy-h[data-c="ne"] { right: -12px; top: -12px; cursor: nesw-resize; }
.wy-h[data-c="sw"] { left: -12px; bottom: -12px; cursor: nesw-resize; }
.wy-h[data-c="se"] { right: -12px; bottom: -12px; cursor: nwse-resize; }

.wy-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
}

.wy-kinds {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.wy-kinds[hidden] {
    display: none;
}

.wy-kinds button {
    padding: 6px 11px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

.wy-kinds button.on {
    border-color: rgba(139, 92, 246, 0.6);
    background: var(--accent-subtle);
    color: #ddd6fe;
}

.wy-kinds button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wy-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.wy-actions .add-item-btn {
    padding: 9px 20px;
    font-size: 0.92rem;
}

.wy-actions .add-item-btn:disabled {
    opacity: 0.45;
    transform: none;
    cursor: not-allowed;
    animation: none;
}

.wy-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px 12px;
}

.wy-strip[hidden] {
    display: none;
}

.wy-count {
    flex: 0 0 auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6ee7b7;
}

.wy-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.wy-thumb {
    position: relative;
    flex: 0 0 auto;
    width: 64px;
    height: 48px;
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.wy-thumb.ans {
    border-color: #10b981;
}

.wy-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wy-thumb em {
    position: absolute;
    inset: auto 0 0;
    padding: 1px 3px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.56rem;
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Daily ===== */
.dy {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.dy-card {
    padding: 20px;
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    background: radial-gradient(120% 80% at 100% 0%, rgba(16, 185, 129, 0.1), transparent 55%), var(--glass-bg);
    box-shadow: var(--shadow-card);
}

.dy-today-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 16px;
}

.dy-today-head h2 {
    margin: 0;
    font-size: 1.2rem;
}

.dy-date {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.dy-intensity {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: rgba(13, 13, 15, 0.5);
}

.dy-intensity button {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.dy-intensity button em {
    font-style: normal;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dy-intensity button.on {
    background: rgba(16, 185, 129, 0.16);
    color: #a7f3d0;
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.4);
}

.dy-intensity button.on em {
    color: #6ee7b7;
}

.dy-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.dy-bar {
    flex: 1;
    height: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.dy-bar i {
    display: block;
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, #059669, #34d399);
    transition: width 0.4s ease;
}

.dy-progress.full {
    color: #6ee7b7;
}

.dy-done-msg {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.1);
    color: #a7f3d0;
    font-size: 0.88rem;
}

.dy-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
}

.dy-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-surface-solid);
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.dy-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.dy-item.done {
    opacity: 0.72;
}

.dy-item.done.ok { border-color: rgba(16, 185, 129, 0.35); }
.dy-item.done.hard { border-color: rgba(245, 158, 11, 0.35); }
.dy-item.done.bad { border-color: rgba(239, 68, 68, 0.35); }

.dy-thumb,
.dy-tthumb {
    position: relative;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 9px;
    background: #fff;
}

.dy-thumb {
    width: 92px;
    height: 64px;
}

.dy-thumb img,
.dy-tthumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    opacity: 0;
    transition: opacity 0.2s;
}

.dy-thumb img.ready,
.dy-tthumb img.ready {
    opacity: 1;
}

.dy-thumb.text,
.dy-tthumb.text {
    place-items: start;
    padding: 6px 8px;
    background: linear-gradient(180deg, #faf8f1, #f1ede0);
}

.dy-thumb.text span,
.dy-tthumb.text span {
    color: #3f3a2e;
    font-size: 0.66rem;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.dy-thumb.missing::after,
.dy-tthumb.missing::after {
    content: "brak pliku";
    position: absolute;
    color: #71717a;
    font-size: 0.7rem;
}

.dy-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dy-info strong {
    font-size: 0.92rem;
}

.dy-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dy-cat i {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    background: var(--c);
}

.dy-state {
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.dy-go {
    flex: 0 0 auto;
    padding: 6px 11px;
    border-radius: 9px;
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.dy-item.done .dy-go {
    background: transparent;
    font-size: 1rem;
}

.dy-foot {
    margin-top: 12px;
}

.dy-start,
.dy-empty {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
}

.dy-empty div {
    margin-top: 10px;
}

.dy-steps {
    margin: 0 0 14px;
    padding-left: 20px;
}

.dy-steps li {
    margin-bottom: 6px;
}

.dy-steps b {
    color: var(--text-main);
}

.dy-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dy-base-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    margin-bottom: 12px;
}

.dy-base-head h3 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dy-base-head span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dy-cats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.dy-catcard {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: var(--glass-bg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.dy-catcard::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--c);
}

.dy-catcard:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.dy-catcard.off {
    opacity: 0.55;
}

.dy-catcard-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dy-catcard-top strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
}

.dy-catcard-pics {
    display: flex;
    gap: 6px;
    height: 54px;
}

.dy-catcard-pics img {
    flex: 1;
    min-width: 0;
    height: 100%;
    border-radius: 6px;
    background: #fff;
    object-fit: cover;
    object-position: top left;
    opacity: 0;
    transition: opacity 0.2s;
}

.dy-catcard-pics img.ready {
    opacity: 1;
}

.dy-nopics {
    align-self: center;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.dy-catcard-meta {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.dy-newcat {
    justify-content: center;
    border-style: dashed;
    border-color: var(--border-hover);
    background: transparent;
    box-shadow: none;
    cursor: default;
}

.dy-newcat::before {
    display: none;
}

.dy-newcat:hover {
    transform: none;
}

.dy-newcat input {
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    background: rgba(13, 13, 15, 0.6);
    color: var(--text-main);
    font: inherit;
    font-size: 0.88rem;
}

.dy-note {
    margin: 12px 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* przełącznik */
.dy-switch {
    position: relative;
    flex: 0 0 auto;
    display: inline-block;
    width: 36px;
    height: 20px;
    cursor: pointer;
}

.dy-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.dy-switch span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
    transition: background 0.2s;
}

.dy-switch span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}

.dy-switch input:checked + span {
    background: #10b981;
}

.dy-switch input:checked + span::after {
    transform: translateX(16px);
}

.dy-switch input:focus-visible + span {
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.7);
}

.dy-switch-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* widok działu */
.dy-cathead {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.dy-cathead h2 {
    margin: 0;
    font-size: 1.2rem;
    word-break: break-word;
}

.dy-back {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.dy-back:hover {
    border-color: var(--border-hover);
    color: var(--text-main);
}

.dy-tasks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}

.dy-task {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--bg-surface-solid);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.dy-task:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.dy-task.frozen .dy-tthumb {
    filter: saturate(0.4) brightness(0.8);
}

.dy-tthumb {
    width: 100%;
    height: 120px;
    border-radius: 0;
}

.dy-task-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 38px 10px 11px;
}

.dy-task-name {
    font-size: 0.86rem;
    font-weight: 600;
}

.dy-task-state {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.dy-task.frozen .dy-task-state {
    color: #93c5fd;
}

.dy-ans-chip {
    align-self: flex-start;
    margin-top: 3px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    font-size: 0.68rem;
}

.dy-task .nt-more {
    right: 4px;
    bottom: 8px;
}

/* okienka */
.dy-modal {
    z-index: 10100;
}

.dy-src {
    display: grid;
    gap: 10px;
}

.dy-src button {
    display: grid;
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.dy-src button:hover {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.06);
}

.dy-src span {
    grid-row: 1 / 3;
    font-size: 1.5rem;
    text-align: center;
}

.dy-src b {
    font-size: 0.92rem;
}

.dy-src em {
    font-style: normal;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.dy-modal-extra {
    margin: 14px 0 0;
}

.dy-pick-group {
    margin-bottom: 14px;
}

.dy-pick-group > span {
    display: block;
    margin-bottom: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.dy-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.dy-pick {
    position: relative;
    aspect-ratio: 3 / 4;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
}

.dy-pick:hover {
    border-color: #10b981;
}

.dy-pick img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.dy-pick em {
    position: absolute;
    inset: auto 0 0;
    padding: 2px 5px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 0.66rem;
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* rozwiązywanie */
body.dy-solve-open {
    overflow: hidden;
}

.dy-solve {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(6px);
    outline: none;
    animation: fadeIn 0.18s ease;
}

.dy-solve[hidden] {
    display: none;
}

.dy-s-card {
    display: flex;
    flex-direction: column;
    width: min(820px, 100%);
    max-height: 100%;
    border: 1px solid var(--border-hover);
    border-radius: 18px;
    background: var(--bg-surface-solid);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.dy-s-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 12px 18px;
    border-bottom: 1px solid var(--border-color);
}

.dy-s-head strong {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dy-s-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.dy-s-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.dy-s-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 16px 18px;
}

.dy-s-img {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #fff;
    overflow: auto;
    cursor: zoom-in;
}

.dy-s-img img {
    display: block;
    max-width: 100%;
    max-height: 55vh;
    margin: 0 auto;
}

.dy-s-img.big {
    cursor: zoom-out;
}

.dy-s-zoomhint {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
}

.dy-s-img.big img {
    max-width: none;
    max-height: none;
    width: 160%;
}

.dy-s-text {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: linear-gradient(180deg, #faf8f1, #f3efe3);
    color: #2f2b22;
    white-space: pre-wrap;
    line-height: 1.6;
}

.dy-s-text:first-child {
    margin-top: 0;
}

.dy-s-ans {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-hover);
}

.dy-s-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6ee7b7;
}

.dy-s-text.ans {
    background: linear-gradient(180deg, #ecfdf5, #d1fae5);
    color: #064e3b;
}

.dy-s-foot {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px 18px;
    border-top: 1px solid var(--border-color);
}

.dy-s-show {
    align-self: flex-start;
    padding: 8px 14px;
}

.dy-s-show[hidden] {
    display: none;
}

.dy-s-noans,
.dy-s-rated {
    margin: 0;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.dy-linkbtn {
    padding: 0;
    border: 0;
    background: none;
    color: #a78bfa;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.dy-rate {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.dy-r {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 8px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
    font: inherit;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.dy-r span {
    font-size: 1.5rem;
}

.dy-r b {
    font-size: 0.9rem;
}

.dy-r em {
    font-style: normal;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dy-r:hover {
    transform: translateY(-2px);
}

.dy-r.ok:hover { border-color: #10b981; background: rgba(16, 185, 129, 0.1); }
.dy-r.hard:hover { border-color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.dy-r.bad:hover { border-color: #ef4444; background: rgba(239, 68, 68, 0.1); }

@media (max-width: 760px) {
    .dy-card {
        padding: 14px;
    }

    .dy-today-head {
        flex-direction: column;
        align-items: stretch;
    }

    .dy-intensity {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .dy-intensity button {
        justify-content: center;
        padding: 8px 4px;
    }

    .dy-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .dy-thumb {
        width: 76px;
        height: 58px;
    }

    .dy-cats,
    .dy-tasks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .dy-newcat {
        grid-column: 1 / -1;
        flex-direction: row;
    }

    .dy-newcat input {
        flex: 1;
        min-width: 0;
    }

    .dy-tthumb {
        height: 96px;
    }

    .dy-solve {
        padding: 0;
    }

    .dy-s-card {
        height: 100%;
        border: 0;
        border-radius: 0;
    }

    .dy-s-img img {
        max-height: 48vh;
    }

    .dy-rate {
        gap: 8px;
    }

    .dy-r {
        padding: 10px 4px;
    }

    .wy-bar {
        flex-wrap: wrap;
        padding: 8px 10px;
    }

    .wy-hint {
        font-size: 0.72rem;
    }

    .wy-zoom {
        display: none;
    }

    .wy-tools {
        padding: 8px 10px;
    }

    .wy-kinds {
        width: 100%;
        overflow-x: auto;
    }

    .wy-actions {
        width: 100%;
    }

    .wy-actions .add-item-btn {
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dy-item,
    .dy-catcard,
    .dy-task,
    .dy-r,
    .dy-bar i {
        transition: none;
    }
}

/* Daily: szybkie przyciski pod „Rozwiąż”, dobieranie z działu */
.dy-side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.dy-mini {
    display: flex;
    gap: 6px;
}

.dy-mini:empty {
    display: none;
}

.dy-mini-btn {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.72rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.dy-mini-btn.skip:hover,
.dy-mini-btn.skip:focus-visible {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.dy-mini-btn.thaw {
    color: #93c5fd;
}

.dy-mini-btn.thaw:hover,
.dy-mini-btn.thaw:focus-visible {
    border-color: rgba(96, 165, 250, 0.6);
    background: rgba(59, 130, 246, 0.12);
}

.dy-item.done .dy-mini-btn {
    opacity: 1;
}

.dy-catcard-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dy-pickone {
    flex: 0 0 auto;
    padding: 4px 9px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.08);
    color: #6ee7b7;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
}

.dy-pickone:hover {
    background: rgba(16, 185, 129, 0.16);
}

/* wycinek: zaznaczone już fragmenty (zasłanianie do fiszek) */
.wy-mark {
    position: absolute;
    display: grid;
    place-items: center;
    border: 2px solid #f59e0b;
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.55);
    color: #1c1917;
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.wy-chip {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid rgba(245, 158, 11, 0.5);
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    font-size: 0.74rem;
    white-space: nowrap;
}

/* ===== Fiszki ===== */
.fz .dy-card {
    background: radial-gradient(120% 80% at 100% 0%, rgba(139, 92, 246, 0.12), transparent 55%), var(--glass-bg);
}

.fz-start h2,
.fz-today h2 {
    margin: 0 0 12px;
    font-size: 1.2rem;
}

.fz-today-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.fz-today-head h2 {
    margin: 0;
}

.fz-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.fz-mode {
    display: grid;
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-surface-solid);
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.fz-mode:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.5);
}

.fz-mode.blitz:hover:not(:disabled) {
    border-color: rgba(245, 158, 11, 0.6);
}

.fz-mode:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.fz-mode-ico {
    grid-row: 1 / 3;
    font-size: 1.5rem;
    text-align: center;
}

.fz-mode b {
    font-size: 0.92rem;
}

.fz-mode em {
    font-style: normal;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.fz-due {
    min-width: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-primary);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    text-align: center;
}

.fz-deck-bar {
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.fz-deck-bar i {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: var(--c);
}

.fz-go {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
}

.fz-setting {
    margin-top: 14px;
}

.fz-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fz-row {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) auto 34px;
    align-items: center;
    gap: 12px;
    padding: 8px 6px 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: var(--bg-surface-solid);
    cursor: pointer;
}

.fz-row:hover {
    border-color: var(--border-hover);
}

.fz-row-type {
    text-align: center;
}

.fz-row-thumb {
    width: 34px;
    height: 26px;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.fz-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fz-row-front,
.fz-row-back {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
}

.fz-row-back {
    color: var(--text-secondary);
}

.fz-row-due {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.fz-row.due .fz-row-due {
    color: #c4b5fd;
}

.fz-row .nt-more {
    position: static;
}

/* sesja */
.fz-card .dy-s-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 260px;
}

.fz-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
}

.fz-progress i {
    display: block;
    height: 100%;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

.fz-face {
    text-align: center;
}

.fz-text {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.fz-face.back .fz-q {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.fz-face.back .fz-a {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-hover);
    color: #a7f3d0;
}

.fz-sub {
    margin: 8px 0 0;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.fz-items {
    display: inline-block;
    margin: 14px auto 0;
    padding-left: 22px;
    text-align: left;
    font-size: 1rem;
    line-height: 1.7;
    color: #a7f3d0;
}

.fz-occl {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.fz-occl img {
    max-width: 100%;
    max-height: 56vh;
}

.fz-occ {
    position: absolute;
    display: grid;
    place-items: center;
    border-radius: 3px;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
}

.fz-occ.other {
    background: #a8a29e;
    border: 1px solid #78716c;
}

.fz-occ.target {
    background: #f59e0b;
    border: 2px solid #b45309;
    color: #451a03;
}

.fz-occ.shown {
    border: 3px solid #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.fz-flip {
    align-self: center;
    padding: 11px 24px;
    font-size: 0.95rem;
}

kbd {
    margin-left: 6px;
    padding: 1px 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.68rem;
    opacity: 0.7;
}

.fz-rate .dy-r kbd {
    margin: 4px 0 0;
}

.fz-typeform {
    gap: 10px;
}

.fz-input {
    margin: 0;
    font-size: 1.05rem;
    text-align: center;
}

.fz-input.shake {
    animation: fzShake 0.35s ease;
    border-color: rgba(239, 68, 68, 0.6);
}

@keyframes fzShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.fz-row-btns {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.fz-verdict {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.92rem;
    text-align: center;
}

.fz-verdict.good { background: rgba(16, 185, 129, 0.12); color: #a7f3d0; }
.fz-verdict.mid { background: rgba(245, 158, 11, 0.12); color: #fde68a; }
.fz-verdict.bad { background: rgba(239, 68, 68, 0.12); color: #fecaca; }

.dy-s-foot .fz-verdict {
    margin-top: 0;
}

/* Blitz */
.fz-blitz-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.fz-blitz-top .fz-text {
    text-align: left;
}

.fz-timer {
    flex: 0 0 auto;
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

.fz-blitz-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    font-weight: 700;
    color: #fcd34d;
    font-variant-numeric: tabular-nums;
}

.fz-bbar {
    flex: 1;
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.fz-bbar i {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    transition: width 0.3s ease;
}

.fz-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fz-chip {
    padding: 7px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: transparent;
    text-shadow: 0 0 9px rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    user-select: none;
    transition: background 0.25s, color 0.25s, text-shadow 0.25s, border-color 0.25s;
}

.fz-chip.hit {
    border-color: rgba(16, 185, 129, 0.6);
    background: rgba(16, 185, 129, 0.16);
    color: #a7f3d0;
    text-shadow: none;
}

.fz-chip.miss {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
    color: #fecaca;
    text-shadow: none;
}

/* podsumowanie */
.fz-summary .dy-s-body {
    align-items: center;
    text-align: center;
}

.fz-big {
    font-size: 2.6rem;
}

.fz-summary h2 {
    margin: 6px 0 10px;
}

.fz-sum-line {
    display: flex;
    gap: 16px;
    margin: 0;
    font-weight: 700;
}

.fz-sum-line .ok { color: #6ee7b7; }
.fz-sum-line .hard { color: #fcd34d; }
.fz-sum-line .bad { color: #fca5a5; }

@media (max-width: 760px) {
    .fz-modes {
        grid-template-columns: minmax(0, 1fr);
    }

    .fz .dy-cats {
        grid-template-columns: minmax(0, 1fr);
    }

    .fz-row {
        grid-template-columns: 30px minmax(0, 1fr) auto 32px;
    }

    .fz-row-back {
        display: none;
    }

    .fz-text {
        font-size: 1.15rem;
    }

    .fz-card .dy-s-body {
        min-height: 0;
    }

    .fz-row-btns {
        justify-content: stretch;
    }

    .fz-row-btns > * {
        flex: 1;
    }

    kbd {
        display: none;
    }
}

/* Okienko pytania (MT.ask) zamiast confirm()/prompt() */
.mt-ask { z-index: 10300; }
.mt-ask .modal-content { width: 400px; }
.mt-ask-msg { margin: 0 0 18px; color: var(--text-main); font-size: 0.95rem; line-height: 1.5; white-space: pre-line; }
.mt-ask-danger { background: linear-gradient(135deg, #dc2626, #ef4444); box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25); }
.mt-ask-danger:hover { box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35); }

/* ===== Poziom i ranga (js/poziom.js) ===== */

/* plakietka w widżecie Formy: odznaka rangi + POZIOM N */
.ft-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ft-badge .rank-badge {
    width: 17px;
    height: 17px;
    margin-left: -5px;
    flex: none;
}

/* profil w menu: obwódka w kolorze rangi, odznaka w rogu, aparat po lewej */
.sm-avatar {
    box-shadow: 0 0 0 2px var(--ring), 0 0 0 4px var(--ring2, transparent), 0 0 18px color-mix(in srgb, var(--ring) 35%, transparent);
}

.sm-cam {
    right: auto;
    left: -3px;
}

.sm-rank {
    position: absolute;
    right: -8px;
    bottom: -8px;
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    pointer-events: none;
}

.sm-rank .rank-badge {
    width: 100%;
    height: 100%;
    display: block;
}

.sm-level {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 6px;
}

.sm-level[hidden] {
    display: none;
}

.sm-lv-title {
    font-size: 0.82rem;
    font-weight: 600;
}

.sm-lv-bar {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.sm-lv-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.sm-lv-pts {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.sm-lv-forma {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.sm-lv-forma i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

/* ekran awansu na nową rangę */
.lv-up {
    position: fixed;
    inset: 0;
    z-index: 10250;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(5, 5, 8, 0.82);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lv-up.show {
    opacity: 1;
}

.lv-up.out {
    opacity: 0;
}

.lv-card {
    width: min(380px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 30px 26px 24px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    background: var(--bg-surface-solid);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    transform: scale(0.94) translateY(10px);
    transition: transform 0.35s cubic-bezier(.2, 1.4, .4, 1);
}

.lv-up.show .lv-card {
    transform: none;
}

.lv-eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--rank-text);
}

.lv-badge {
    position: relative;
    width: 200px;
    height: 200px;
    display: grid;
    place-items: center;
}

.lv-badge .rank-badge {
    position: relative;
    width: 150px;
    height: 150px;
    animation: lvPop 0.7s cubic-bezier(.2, 1.5, .4, 1) both 0.1s;
}

.lv-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--rank) 34%, transparent) 0%, color-mix(in srgb, var(--rank) 10%, transparent) 45%, transparent 70%);
    animation: lvGlow 2.4s ease-in-out infinite;
}

.lv-spark {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--rank-text);
    clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
    animation: uczTwinkle 1.8s ease-in-out infinite;
}

.lv-spark.s1 { left: 14px; top: 34px; }
.lv-spark.s2 { right: 18px; top: 56px; width: 10px; height: 10px; animation-delay: 0.4s; }
.lv-spark.s3 { right: 32px; bottom: 26px; width: 16px; height: 16px; animation-delay: 0.9s; }
.lv-spark.s4 { left: 36px; bottom: 40px; width: 9px; height: 9px; animation-delay: 1.3s; }

.lv-level {
    font-family: var(--font-family);
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.lv-rank {
    font-family: var(--font-family);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--rank-text);
}

.lv-next {
    margin: 2px 0 6px;
    max-width: 290px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.lv-reward {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    text-align: left;
}

.lv-reward-biret {
    width: 64px;
    height: 56px;
    flex: none;
}

.lv-reward-biret .biret {
    width: 100%;
    height: 100%;
}

.lv-reward b {
    display: block;
    font-size: 0.86rem;
}

.lv-reward span {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.lv-ok {
    width: 100%;
    height: 48px;
    margin-top: 10px;
    border: 0;
    border-radius: 14px;
    background: var(--accent-strong);
    color: #fff;
    font-family: var(--font-family);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
}

.lv-ok:hover {
    background: #6d28d9;
}

.lv-ok:focus-visible {
    outline: 2px solid #c4b5fd;
    outline-offset: 3px;
}

@keyframes lvPop {
    from { transform: scale(0.3) rotate(-12deg); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@keyframes lvGlow {
    0%, 100% { transform: scale(0.94); opacity: 0.85; }
    50% { transform: scale(1.04); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .lv-up, .lv-card { transition: none; }
    .lv-badge .rank-badge, .lv-glow, .lv-spark { animation: none; }
}

.test-panel .tp-lv {
    margin: 10px 0 6px;
}

.test-panel .tp-lv span {
    color: var(--text-muted);
}

/* ===== Zeszyt odręczny (js/zeszyt.js) ===== */
.zs {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    flex-direction: column;
    background: #0b0b0e;
    color: var(--text-main);
}

.zs[hidden] {
    display: none;
}

.zs-bar {
    flex: none;
    height: 56px;
    box-sizing: content-box;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: env(safe-area-inset-top, 0px) max(10px, env(safe-area-inset-right, 0px)) 0 max(10px, env(safe-area-inset-left, 0px));
    border-bottom: 1px solid var(--border-color);
    background: #0b0b0e;
}

.zs-back {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 32%;
    height: 42px;
    padding: 0 12px 0 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font: 500 0.86rem var(--font-family);
    cursor: pointer;
}

.zs-back:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.zs svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.zs-back svg,
.zs-ib svg {
    width: 22px;
    height: 22px;
    flex: none;
}

.zs-ib svg circle {
    fill: currentColor;
    stroke: none;
}

.zs-path {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zs-title {
    flex: 1;
    min-width: 0;
    padding: 6px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-main);
    font: 600 1.1rem var(--font-family);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.zs-title:hover {
    background: rgba(255, 255, 255, 0.04);
}

.zs-right {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: none;
}

.zs-ib {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
}

.zs-ib:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
}

.zs-ib:disabled {
    color: #4a4a57;
    cursor: default;
}

.zs-more-btn {
    margin-left: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #16161b;
}

.zs-saved {
    padding: 0 8px;
    font-size: 0.8rem;
    color: #86efac;
    white-space: nowrap;
}

.zs-saved.busy {
    color: var(--text-muted);
}

.zs-saved.err {
    color: #fca5a5;
}

.zs-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    cursor: crosshair;
}

.zs-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.zs-live {
    pointer-events: none;
}

/* zaznaczenie: ramka, uchwyty w rogach, pasek z akcjami */
.zs-sel {
    position: absolute;
    pointer-events: none;
}

.zs-sel[hidden] {
    display: none;
}

.zs-sel-box {
    position: absolute;
    inset: 0;
    border: 1.5px dashed #a78bfa;
    border-radius: 6px;
    background: rgba(167, 139, 250, 0.06);
}

.zs-h {
    position: absolute;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    pointer-events: auto;
    touch-action: none;
    cursor: nwse-resize;
}

.zs-h::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid #8b5cf6;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.zs-h[data-h="nw"] { left: 0; top: 0; }
.zs-h[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.zs-h[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.zs-h[data-h="se"] { left: 100%; top: 100%; }

.zs-sel-bar {
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translate(-50%, -12px);
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: #1b1a22;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    white-space: nowrap;
}

.zs-sel-bar.below {
    bottom: auto;
    top: 100%;
    transform: translate(-50%, 12px);
}

.zs-sel-bar button {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-main);
    font: 500 0.85rem var(--font-family);
    cursor: pointer;
}

.zs-sel-bar button:hover {
    background: rgba(255, 255, 255, 0.06);
}

.zs-sel-bar button svg {
    width: 17px;
    height: 17px;
}

.zs-sel-bar .danger {
    color: #fca5a5;
}

.zs-sel.busy .zs-sel-bar,
.zs-sel.busy .zs-h {
    opacity: 0;
}

.zs-hint {
    position: absolute;
    left: 50%;
    top: 14px;
    max-width: calc(100% - 32px);
    transform: translateX(-50%);
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(22, 22, 27, 0.94);
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-align: center;
    pointer-events: none;
    opacity: 0;
}

.zs-hint.show {
    animation: zsHint 6s ease forwards;
}

@keyframes zsHint {
    0% { opacity: 0; transform: translate(-50%, -6px); }
    7%, 85% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, 0); }
}

.zs-zoom {
    position: absolute;
    right: 12px;
    top: 12px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(22, 22, 27, 0.92);
    color: var(--text-secondary);
    font: 600 0.78rem var(--font-family);
    cursor: pointer;
}

.zs-zoom[hidden] {
    display: none;
}

/* pigułka z narzędziami */
.zs-pill {
    position: absolute;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    z-index: 2;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    background: #1b1a22;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}

.zs-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.zs-tool {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.zs-tool svg {
    width: 22px;
    height: 22px;
}

.zs-tool:hover {
    color: var(--text-main);
}

.zs-tool.on {
    background: rgba(167, 139, 250, 0.2);
    color: #c4b5fd;
}

.zs-sep {
    width: 1px;
    height: 28px;
    margin: 0 6px;
    background: rgba(255, 255, 255, 0.1);
}

.zs-color,
.zs-size-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
}

.zs-color::before {
    content: "";
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--c);
}

.zs-color.on::before {
    box-shadow: 0 0 0 3px #1b1a22, 0 0 0 5px var(--c);
}

.zs-size-btn i {
    display: block;
    border-radius: 50%;
    background: #a3a3b0;
}

.zs-size-btn.on {
    background: rgba(255, 255, 255, 0.08);
}

.zs-size-btn.on i {
    background: #ececf1;
}

.zs-tool:focus-visible,
.zs-color:focus-visible,
.zs-size-btn:focus-visible,
.zs-ib:focus-visible,
.zs-combo:focus-visible {
    outline: 2px solid #c4b5fd;
    outline-offset: 2px;
}

.zs-combo {
    display: none;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 10px 0 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
}

.zs-combo .zs-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px #1b1a22, 0 0 0 4.5px rgba(255, 255, 255, 0.5);
}

.zs-combo .zs-size {
    display: block;
    border-radius: 50%;
    background: #ececf1;
}

.zs-pill.no-ink .zs-ink {
    display: none !important;
}

/* Kształty: wybór linia / koło / prostokąt (w pigułce na szerokim ekranie, w palecie zawsze) */
.zs-pill:not(.is-shape) .zs-shapes {
    display: none !important;
}

.zs-shape-btn {
    width: 40px;
    height: 40px;
}

.zs-shape-btn svg {
    width: 20px;
    height: 20px;
}

.zs-shape-btn.on {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.zs-pal-shape[hidden] {
    display: none;
}

.zs-palette .zs-shape-seg {
    margin: 0 0 14px;
}

.zs-shape-seg button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 58px;
    font-size: 0.74rem;
}

.zs-shape-seg button svg {
    flex: none;
    width: 24px;
    height: 24px;
}

/* paleta i menu */
.zs-pop {
    position: absolute;
    z-index: 3;
    box-sizing: border-box;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    background: #1b1a22;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}

.zs-pop[hidden] {
    display: none;
}

.zs-pop-label {
    margin-bottom: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.zs-palette {
    left: 50%;
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    width: min(320px, calc(100vw - 32px));
    transform: translateX(-50%);
}

.zs-palette-colors {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 14px;
}

.zs-palette-colors .zs-color {
    width: 100%;
}

.zs-palette-sizes {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.zs-pop-note {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.zs-menu {
    right: max(10px, env(safe-area-inset-right, 0px));
    top: calc(60px + env(safe-area-inset-top, 0px));
    display: flex;
    flex-direction: column;
    width: min(330px, calc(100vw - 20px));
    max-height: calc(100% - 80px);
    padding: 8px;
    overflow-y: auto;
}

.zs-menu > .zs-pop-label {
    padding: 8px 10px 0;
}

.zs-seg {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: 0 6px 10px;
    padding: 4px;
    border-radius: 12px;
    background: #121217;
}

.zs-seg button {
    height: 36px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    font: 500 0.84rem var(--font-family);
    cursor: pointer;
}

.zs-seg button.on {
    background: rgba(167, 139, 250, 0.2);
    color: #c4b5fd;
    font-weight: 600;
}

.zs-menu-sep {
    height: 1px;
    margin: 0 6px 6px;
    background: rgba(255, 255, 255, 0.07);
}

.zs-menu > button {
    flex: none;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-main);
    font: 500 0.9rem var(--font-family);
    text-align: left;
    cursor: pointer;
}

.zs-menu > button:hover,
.zs-menu > button:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    outline: none;
}

.zs-menu > button.danger {
    color: #fca5a5;
}

/* wybór zdjęcia z Notatek */
.zs-pick {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.72);
}

.zs-pick[hidden] {
    display: none;
}

.zs-pick-card {
    box-sizing: border-box;
    width: min(720px, 100%);
    max-height: 100%;
    padding: 16px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--bg-surface-solid);
}

.zs-pick-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.zs-pick-group > span {
    display: block;
    margin: 12px 0 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.zs-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

.zs-pick-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font: 0.75rem var(--font-family);
    text-align: left;
    cursor: pointer;
}

.zs-pick-item:hover {
    border-color: rgba(167, 139, 250, 0.5);
}

.zs-pick-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    background: #000;
}

.zs-pick-item em {
    overflow: hidden;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zs-pick-empty {
    color: var(--text-muted);
}

/* telefon pionowo: pigułka z 4 narzędziami + jeden przycisk koloru i grubości */
@media (max-width: 640px) {
    .zs-path,
    .zs-colors,
    .zs-sizes,
    .zs-wide {
        display: none !important;
    }

    .zs-back {
        padding: 0;
        width: 42px;
        justify-content: center;
    }

    .zs-saved {
        padding: 0 4px;
        font-size: 0.72rem;
    }

    .zs-combo {
        display: flex;
    }

    .zs-tool {
        width: 44px;
        height: 44px;
    }

    .zs-pill {
        padding: 5px 6px;
    }

    .zs-sep {
        margin: 0 3px;
    }

    .zs-ib {
        width: 40px;
    }
}

/* telefon poziomo: niższy pasek, narzędzia w pionowej pigułce po prawej */
@media (orientation: landscape) and (max-height: 520px) {
    .zs-bar {
        height: 44px;
    }

    .zs-ib,
    .zs-back {
        height: 38px;
    }

    .zs-pill {
        left: auto;
        right: calc(10px + env(safe-area-inset-right, 0px));
        top: 50%;
        bottom: auto;
        flex-direction: column;
        transform: translateY(-50%);
        padding: 5px;
        border-radius: 26px;
    }

    .zs-group {
        flex-direction: column;
    }

    .zs-sep {
        width: 28px;
        height: 1px;
        margin: 3px 0;
    }

    .zs-colors,
    .zs-sizes,
    .zs-wide {
        display: none !important;
    }

    .zs-combo {
        display: flex;
        flex-direction: column;
        gap: 6px;
        height: auto;
        padding: 8px 0;
    }

    .zs-tool {
        width: 42px;
        height: 42px;
    }

    .zs-palette {
        left: auto;
        right: calc(74px + env(safe-area-inset-right, 0px));
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        max-height: calc(100% - 20px);
        overflow-y: auto;
    }

    .zs-hint {
        top: 8px;
    }

    .zs-zoom {
        right: auto;
        left: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zs-hint.show {
        animation: none;
        opacity: 1;
    }
}

/* Notatki: wybór strony notatki odręcznej w Daily i Fiszkach */
.dy-pick.pen .dy-pick-pen {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    background: #121217;
    font-size: 1.6rem;
}

.dy-cat-pick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* menu konta: miejsce na pliki */
.sm-storage {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: -8px 0 16px;
    padding: 12px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: var(--glass-bg);
}

.sm-storage-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.8rem;
}

.sm-storage-top b {
    font-weight: 600;
}

.sm-storage-top span {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.sm-storage-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.sm-storage-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #8b5cf6;
}

.sm-storage-bar i.warn {
    background: #f59e0b;
}

.sm-storage-parts {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* gdy zeszyt jest otwarty, komunikaty pojawiają się pod paskiem u góry (dół zajmuje pigułka z narzędziami) */
body.zs-open .toast {
    top: calc(68px + env(safe-area-inset-top, 0px));
    bottom: auto;
    transform: translate(-50%, -12px);
}

body.zs-open .toast.visible {
    transform: translate(-50%, 0);
}

/* zeszyt: przyciski powiększenia (− 100% +) w prawym górnym rogu */
.zs-zoomctl {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(22, 22, 27, 0.92);
}

.zs-zoomctl button {
    height: 32px;
    min-width: 32px;
    padding: 0 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-main);
    font: 600 1rem var(--font-family);
    cursor: pointer;
}

.zs-zoomctl button:hover {
    background: rgba(255, 255, 255, 0.07);
}

.zs-zoomctl button:focus-visible {
    outline: 2px solid #c4b5fd;
    outline-offset: 1px;
}

.zs-zoomctl .zs-zoom {
    position: static;
    min-width: 54px;
    height: 32px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font: 600 0.78rem var(--font-family);
    font-variant-numeric: tabular-nums;
}

.zs-zoomctl .zs-zoom.off {
    color: var(--text-muted);
}

/* na telefonie w pionie przybliża się dwoma palcami — bez przycisków */
@media (max-width: 640px) {
    .zs-zoomctl {
        display: none;
    }
}

@media (orientation: landscape) and (max-height: 520px) {
    .zs-zoomctl {
        right: auto;
        left: 12px;
        top: 8px;
    }
}

/* telefon/tablet: przeglądarka rysuje pasek przewijania nad wszystkim (także nad widżetem Formy),
   więc na ekranach dotykowych go chowamy — przewijanie działa tak samo */
@media (pointer: coarse) {
    html,
    body {
        scrollbar-width: none;
    }

    body::-webkit-scrollbar,
    html::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }
}

/* ===== Statystyki (js/statystyki.js) ===== */
#staty-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 220px;
}

#staty-panel.active {
    display: flex;
}

.st-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.st-tile,
.st-card {
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--bg-surface-solid);
}

.st-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
}

.st-tile-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.st-big {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-family);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.05;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.st-big small {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.st-lv .rank-badge {
    width: 32px;
    height: 32px;
    flex: none;
}

.st-tile-sub {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.st-up {
    color: #86efac;
}

.st-down {
    color: #fca5a5;
}

.st-warn {
    color: #fcd34d;
}

.st-forecast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: 18px;
    background: rgba(139, 92, 246, 0.08);
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.st-forecast b {
    color: var(--text-main);
}

.st-forecast .rank-badge {
    width: 44px;
    height: 44px;
    flex: none;
}

.st-forecast.muted {
    border-color: var(--border-color);
    background: var(--bg-surface-solid);
}

.st-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
}

.st-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.st-card-head h3 {
    margin: 0;
    font-family: var(--font-family);
    font-size: 1.1rem;
    font-weight: 600;
}

.st-card-head > span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.st-grid2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.st-heat-scroll {
    overflow-x: auto;
}

.st-heat svg {
    display: block;
}

.st-heat rect[data-tip] {
    cursor: default;
}

.st-heat rect.st-today {
    stroke: #ececf1;
    stroke-width: 1.5;
}

.st-heat-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.st-heat-legend i {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.st-heat-legend span:first-child {
    margin-right: 4px;
}

.st-heat-legend span:last-child {
    margin-left: 4px;
}

.st-axis {
    font: 500 10.5px var(--font-family);
    fill: var(--text-muted);
}

.st-val {
    font: 600 11px var(--font-family);
    fill: var(--text-main);
}

.st-grid {
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 1;
}

.st-grid.base {
    stroke: rgba(255, 255, 255, 0.16);
}

.st-cross {
    stroke: rgba(255, 255, 255, 0.35);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.st-hit {
    cursor: crosshair;
}

.st-chart {
    min-width: 0;
}

.st-chart svg {
    display: block;
    max-width: 100%;
    touch-action: pan-y;
}

.st-seg {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.st-seg button {
    padding: 5px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font: 600 0.78rem var(--font-family);
    cursor: pointer;
}

.st-seg button[aria-pressed="true"] {
    background: rgba(167, 139, 250, 0.2);
    color: #c4b5fd;
}

.st-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.st-legend span,
.st-stack-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.st-legend i,
.st-stack-legend i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.st-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.st-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) 2.2em minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    font-size: 0.86rem;
}

.st-row-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-main);
}

.st-row-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.st-row-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #9085e9;
}

.st-row-num {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.st-row-ago {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.st-row.warn .st-row-ago {
    color: #fcd34d;
}

.st-note {
    margin: 2px 0 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.st-note.warn {
    color: #fcd34d;
}

.st-note.warn b {
    color: var(--text-main);
}

.st-kv {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.st-kv > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.st-kv span {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.st-kv b {
    font-family: var(--font-family);
    font-size: 1.35rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.st-sub {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.st-stack {
    display: flex;
    gap: 2px;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
}

.st-stack i {
    display: block;
    min-width: 4px;
}

.st-stack-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.st-stack-legend b {
    color: var(--text-main);
}

.st-empty {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.st-foot {
    margin: 0;
    font-size: 0.76rem;
    color: var(--text-muted);
    text-align: center;
}

.st-empty-state .st-empty-biret {
    width: 96px;
    height: 84px;
    margin: 0 auto 8px;
}

.st-empty-state .st-empty-biret .biret {
    width: 100%;
    height: 100%;
}

.st-tip {
    position: fixed;
    z-index: 9000;
    max-width: min(320px, calc(100vw - 16px));
    padding: 7px 10px;
    border: 1px solid var(--border-hover);
    border-radius: 10px;
    background: #1b1a22;
    color: var(--text-main);
    font-size: 0.8rem;
    line-height: 1.4;
    pointer-events: none;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.st-tip[hidden] {
    display: none;
}

@media (max-width: 900px) {
    .st-grid2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .st-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .st-tile {
        padding: 12px 14px;
    }

    .st-big {
        font-size: 1.6rem;
    }

    .st-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 2em;
    }

    .st-row-ago {
        grid-column: 1 / -1;
        margin-top: -4px;
    }
}

/* pasek zakładek: wygaszona krawędź, gdy za nią są kolejne zakładki */
nav.tabs.fade-r {
    -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
    mask-image: linear-gradient(90deg, #000 82%, transparent);
}

nav.tabs.fade-l {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%);
    mask-image: linear-gradient(90deg, transparent, #000 18%);
}

nav.tabs.fade-l.fade-r {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

/* Dane pokazowe do nagrań (?demo=1) — chwila ładowania */
.demo-loading { position: fixed; inset: 0; z-index: 10400; display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--bg-body); color: var(--text-secondary); font-size: 0.95rem; }
.demo-loading span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent-subtle); border-top-color: var(--accent-primary); animation: demo-spin 0.8s linear infinite; }
@keyframes demo-spin { to { transform: rotate(360deg); } }

/* Zwijane tematy w To-Do: strzałka przy nazwie, zwinięty temat = nagłówek + pasek + krótka linijka */
.topic-fold {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin: 0 -4px 0 -6px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
}
.topic-fold span { display: inline-block; transform: rotate(90deg); transition: transform 0.18s ease; }
.topic-fold[aria-expanded="false"] span { transform: rotate(0deg); }
.topic-fold:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.06); }
.topic-fold:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 1px; }

.topic-card.folded { padding-bottom: 10px; }
.topic-card.folded .topic-header { margin-bottom: 8px; }
.topic-card.folded .progress-row { margin-bottom: 6px; }
.topic-card.folded .task-list[hidden],
.topic-card.folded .add-item-form[hidden] { display: none; }
.topic-folded-info {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.78rem;
    text-align: left;
    cursor: pointer;
}
.topic-folded-info:hover { color: var(--text-secondary); }
.menu-item:disabled { opacity: 0.4; cursor: default; }

/* Notatki: kolor przedmiotu (menu ⋯ → Zmień kolor) */
.nt-swatches { display: grid; grid-template-columns: repeat(auto-fill, 38px); gap: 10px; margin-bottom: 14px; }
.nt-swatch { position: relative; display: block; width: 38px; height: 38px; cursor: pointer; }
.nt-swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.nt-swatch span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); transition: transform 0.15s, box-shadow 0.15s; }
.nt-swatch-own span { background: conic-gradient(#ef4444, #f59e0b, #84cc16, #14b8a6, #3b82f6, #8b5cf6, #ec4899, #ef4444); color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.nt-swatch:hover span { transform: scale(1.08); }
.nt-swatch input:checked + span { box-shadow: 0 0 0 2px var(--bg-body), 0 0 0 4px #fff; }
.nt-swatch input:focus-visible + span { box-shadow: 0 0 0 2px var(--bg-body), 0 0 0 4px var(--accent-primary); }
.nt-own-color input[type="color"] { width: 64px; height: 36px; padding: 2px; border: 1px solid var(--border-color); border-radius: 8px; background: transparent; cursor: pointer; }

/* =====================================================================
 * Asystent startowy — okno z maskotką (biret) i krokami ustawień
 * ===================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body.as-open { overflow: hidden; }

.as-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(8, 8, 12, 0.46);
    -webkit-backdrop-filter: blur(7px) saturate(1.1);
    backdrop-filter: blur(7px) saturate(1.1);
    animation: asFade 0.32s ease both;
}
.as-overlay.as-leaving { animation: asFadeOut 0.26s ease both; }
.as-overlay.as-leaving .as-card { animation: asCardOut 0.26s ease both; }

.as-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(720px, 100%);
    max-height: min(780px, calc(100dvh - 32px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: radial-gradient(120% 70% at 0% 0%, rgba(139, 92, 246, 0.13), transparent 60%), linear-gradient(180deg, #1c1a26, #15141c);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(139, 92, 246, 0.06);
    color: var(--text-main);
    font-family: var(--font-family);
    animation: asCardIn 0.55s cubic-bezier(0.2, 0.9, 0.25, 1.12) both;
}

.as-card:focus { outline: none; }
.as-skip {
    margin-left: -10px;
    padding: 6px 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font: 500 0.82rem var(--font-family);
    cursor: pointer;
}
.as-skip:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-main); }
.as-skip[hidden] { display: none; }

/* maskotka i dymek */
.as-head {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding: 28px 30px 6px;
}
.as-mascot {
    position: relative;
    flex: none;
    width: 104px;
    height: 92px;
    animation: asDrop 0.75s cubic-bezier(0.3, 1.45, 0.5, 1) 0.12s both;
}
.as-mascot .biret {
    width: 100%;
    height: 100%;
    overflow: visible;
    transform-origin: 50% 100%;
    animation: asBob 3.4s ease-in-out infinite;
}
.as-mascot.talking .biret { animation: asTalk 0.42s ease-in-out infinite; }
.as-mascot.hop .biret { animation: asHop 0.55s cubic-bezier(0.3, 1.4, 0.5, 1), asBob 3.4s ease-in-out 0.55s infinite; }
.as-mascot.cheer .biret { animation: asCheer 0.9s cubic-bezier(0.3, 1.4, 0.5, 1), asBob 3.4s ease-in-out 0.9s infinite; }
.as-mascot .biret-eyes { transform-box: fill-box; transform-origin: center; animation: asBlink 4.6s ease-in-out 1.2s infinite; }
.as-mascot .biret-tassel { transform-origin: 400px 330px; animation: asTassel 3.4s ease-in-out infinite; }
.as-mascot .biret-spark { animation: asTwinkle 2.2s ease-in-out infinite; }

.as-bubble {
    position: relative;
    flex: 1;
    min-width: 0;
    margin-bottom: 18px;
    padding: 14px 18px;
    border: 1px solid rgba(167, 139, 250, 0.24);
    border-radius: 16px 16px 16px 6px;
    background: #262338;
    font-size: 0.98rem;
    line-height: 1.55;
    transform-origin: 0 100%;
    cursor: default;
}
.as-bubble::before {
    content: "";
    position: absolute;
    left: -8px;
    bottom: 12px;
    width: 14px;
    height: 14px;
    border-left: 1px solid rgba(167, 139, 250, 0.24);
    border-bottom: 1px solid rgba(167, 139, 250, 0.24);
    background: #262338;
    transform: rotate(45deg);
}
.as-bubble.pop { animation: asPop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
.as-say { margin: 0; }
.as-say b { color: #f3e8ff; font-weight: 700; }
.as-rest { visibility: hidden; }

/* treść kroku */
.as-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 30px 20px;
    overscroll-behavior: contain;
}
.as-body.fwd .as-step { animation: asSlideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.as-body.back .as-step { animation: asSlideBack 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.as-in { animation: asUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 70ms + 140ms); }

.as-note {
    margin: 14px 2px 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}
.as-warn { margin: 10px 2px 0; color: #fbbf24; font-size: 0.84rem; }
.as-warn[hidden] { display: none; }

/* krok 1: cel */
.as-goals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.as-goal {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 12px 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font-family: var(--font-family);
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.as-goal:hover { transform: translateY(-3px); border-color: rgba(167, 139, 250, 0.35); background: rgba(139, 92, 246, 0.06); }
.as-goal.on { border-color: #8b5cf6; background: rgba(139, 92, 246, 0.12); box-shadow: 0 10px 30px rgba(139, 92, 246, 0.22); }
.as-goal b { font-size: 1.05rem; font-weight: 700; }
.as-goal small { color: var(--text-secondary); font-size: 0.78rem; line-height: 1.35; }
.as-art { display: block; width: 100%; max-width: 170px; aspect-ratio: 160 / 110; margin-bottom: 4px; }
.as-art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.as-goal:hover .as-art-float, .as-goal.on .as-art-float { animation: asFloat 1.6s ease-in-out infinite; }
.as-art-float { transform-box: fill-box; }

.as-check, .as-tick {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #8b5cf6;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.2s, transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.as-check svg, .as-tick svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.as-goal.on .as-check { opacity: 1; transform: scale(1); }

/* krok 2a: matury */
.as-sec + .as-sec { margin-top: 18px; }
.as-sec h3 {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
}
.as-sec h3 span { color: var(--text-muted); font-size: 0.78rem; font-weight: 500; }
.as-exams {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
}
.as-exam, .as-list {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 38px 10px 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.as-exam:hover, .as-list:hover { border-color: rgba(167, 139, 250, 0.35); }
.as-exam:active, .as-list:active { transform: scale(0.98); }
.as-exam input, .as-list input { position: absolute; opacity: 0; pointer-events: none; }
.as-exam:has(input:checked), .as-list:has(input:checked) { border-color: rgba(139, 92, 246, 0.8); background: rgba(139, 92, 246, 0.12); }
.as-exam:has(input:checked) .as-tick, .as-list:has(input:checked) .as-tick { opacity: 1; transform: scale(1); }
.as-exam:has(input:focus-visible), .as-list:has(input:focus-visible) { outline: 2px solid #c4b5fd; outline-offset: 2px; }
.as-exam .as-tick, .as-list .as-tick { top: 50%; margin-top: -11px; }
.as-exam-ico { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, 0.06); font-size: 1.1rem; }
.as-exam-txt { display: flex; flex-direction: column; min-width: 0; }
.as-exam-txt b { font-size: 0.88rem; font-weight: 600; }
.as-exam-txt small { color: var(--text-muted); font-size: 0.76rem; }

/* krok 2b: data sesji / egzaminu */
.as-date { max-width: 420px; }
.as-date .ark-field span em { color: var(--text-muted); font-style: normal; font-weight: 400; }

/* krok 3: intensywność */
.as-int {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.as-int-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font-family: var(--font-family);
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.as-int-card:hover { transform: translateY(-3px); border-color: rgba(167, 139, 250, 0.35); }
.as-int-card.on { border-color: #8b5cf6; background: rgba(139, 92, 246, 0.12); box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2); }
.as-int-card b { font-size: 1.02rem; }
.as-int-time { color: #c4b5fd; font-size: 0.86rem; font-weight: 600; }
.as-int-card small { color: var(--text-muted); font-size: 0.78rem; line-height: 1.4; }
.as-int-bars { display: flex; align-items: flex-end; gap: 4px; height: 24px; margin-bottom: 4px; }
.as-int-bars i { width: 8px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); }
.as-int-bars i:nth-child(1) { height: 10px; }
.as-int-bars i:nth-child(2) { height: 17px; }
.as-int-bars i:nth-child(3) { height: 24px; }
.as-int-bars i.full { background: linear-gradient(180deg, #a78bfa, #6366f1); }
.as-int-card.on .as-int-bars i.full { animation: asBar 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.as-int-card.on .as-int-bars i.full:nth-child(2) { animation-delay: 60ms; }
.as-int-card.on .as-int-bars i.full:nth-child(3) { animation-delay: 120ms; }

/* krok 4: listy To-Do */
.as-todo-ex {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border: 1px dashed rgba(167, 139, 250, 0.35);
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.06);
}
.as-crumb { font-size: 0.9rem; color: var(--text-secondary); }
.as-crumb b { color: var(--text-main); }
.as-crumb i { margin: 0 6px; color: #a78bfa; font-style: normal; }
.as-crumb-note { color: var(--text-muted); font-size: 0.74rem; }
.as-lists { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.as-list { align-items: flex-start; }
.as-list-txt { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.as-list-txt b { font-size: 0.92rem; }
.as-list-txt small { color: #c4b5fd; font-size: 0.78rem; }
.as-list-txt em { overflow: hidden; color: var(--text-muted); font-size: 0.76rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.as-list.off { opacity: 0.55; cursor: default; }
.as-list.off small { color: var(--text-muted); }

/* krok 5: podsumowanie */
.as-sum { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.as-sum li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}
.as-sum-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(139, 92, 246, 0.14); font-size: 1.2rem; }
.as-sum b { display: block; font-size: 0.94rem; }
.as-sum small { color: var(--text-secondary); font-size: 0.8rem; line-height: 1.4; }

/* stopka */
.as-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.as-dots { display: flex; gap: 6px; margin-right: auto; }
.as-dots i { width: 8px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); transition: width 0.35s, background 0.35s; }
.as-dots i.past { background: rgba(167, 139, 250, 0.55); }
.as-dots i.on { width: 24px; background: linear-gradient(90deg, #8b5cf6, #6366f1); }
.as-back, .as-next {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 12px;
    font: 600 0.9rem var(--font-family);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s, background 0.2s;
}
.as-back { border: 1px solid rgba(255, 255, 255, 0.08); background: transparent; color: var(--text-secondary); }
.as-back:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-main); }
.as-back[hidden] { display: none; }
.as-next { min-width: 120px; border: 0; background: var(--accent-gradient); color: #fff; box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35); }
.as-next:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(139, 92, 246, 0.45); }
.as-next:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
.as-card[data-step="done"] .as-next { animation: asGlow 1.8s ease-in-out 0.8s infinite; }
.as-back:focus-visible, .as-next:focus-visible, .as-skip:focus-visible, .as-goal:focus-visible, .as-int-card:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }

/* konfetti przy podsumowaniu */
.as-confetti { position: absolute; left: 82px; top: 62px; width: 0; height: 0; pointer-events: none; }
.as-confetti i {
    position: absolute;
    width: 8px;
    height: 12px;
    border-radius: 2px;
    background: var(--c);
    opacity: 0;
    animation: asBurst 1.2s cubic-bezier(0.15, 0.7, 0.3, 1) var(--d) forwards;
}

@keyframes asFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes asFadeOut { to { opacity: 0; } }
@keyframes asCardIn { from { opacity: 0; transform: translateY(18px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes asCardOut { to { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes asDrop { 0% { opacity: 0; transform: translateY(-40px) rotate(-12deg) scale(0.7); } 100% { opacity: 1; transform: none; } }
@keyframes asBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-1.5deg); } }
@keyframes asTalk { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(1.5deg) scaleY(1.02); } }
@keyframes asHop { 0% { transform: none; } 35% { transform: translateY(-12px) rotate(-5deg) scale(1.04); } 70% { transform: translateY(1px) scaleY(0.96); } 100% { transform: none; } }
@keyframes asCheer { 0% { transform: none; } 30% { transform: translateY(-18px) rotate(-8deg) scale(1.08); } 55% { transform: translateY(-10px) rotate(8deg) scale(1.08); } 80% { transform: translateY(2px) scaleY(0.95); } 100% { transform: none; } }
@keyframes asBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes asTassel { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(3deg); } }
@keyframes asTwinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes asPop { from { opacity: 0; transform: scale(0.88) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes asUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes asSlideIn { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes asSlideBack { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
@keyframes asFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes asBar { from { transform: scaleY(0.2); transform-origin: bottom; } to { transform: none; } }
@keyframes asGlow { 0%, 100% { box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35); } 50% { box-shadow: 0 6px 30px rgba(139, 92, 246, 0.7); } }
@keyframes asBurst {
    0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(0.6); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 40px)) rotate(var(--r)) scale(1); }
}

@media (max-width: 640px) {
    .as-overlay { padding: 10px; align-items: end; }
    .as-card { max-height: calc(100dvh - 20px); border-radius: 18px; }
    .as-head { gap: 10px; padding: 22px 16px 4px; }
    .as-mascot { width: 72px; height: 64px; }
    .as-bubble { margin-bottom: 12px; padding: 11px 13px; font-size: 0.9rem; }
    .as-body { padding: 10px 16px 16px; }
    .as-foot { padding: 12px 16px 16px; }
    .as-goals { grid-template-columns: 1fr; gap: 8px; }
    .as-goal { display: grid; grid-template-columns: 96px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 12px; row-gap: 0; padding: 8px 40px 8px 8px; text-align: left; }
    .as-goal .as-art { grid-row: 1 / 3; max-width: none; margin: 0; }
    .as-goal b { align-self: end; }
    .as-goal small { align-self: start; }
    .as-check { top: 50%; margin-top: -11px; }
    .as-exams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .as-exam { padding-right: 30px; gap: 8px; }
    .as-exam .as-tick { right: 6px; }
    .as-exam-ico { width: 28px; height: 28px; font-size: 0.95rem; }
    .as-int { grid-template-columns: 1fr; gap: 8px; }
    .as-int-card { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px; padding: 12px 14px; }
    .as-int-card .as-int-bars { grid-row: 1 / 4; align-self: center; margin: 0; }
    .as-next { min-width: 0; flex: 1; max-width: 200px; }
    .as-confetti { left: 52px; top: 50px; }
}

@media (prefers-reduced-motion: reduce) {
    .as-overlay, .as-overlay * { animation: none !important; transition: none !important; }
}


/* Notatki — foldery w temacie (7.11) */
.nt-subfolders {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    margin-bottom: 18px;
}
.nt-subfolder .nt-folder-art { min-height: 88px; }
.nt-tree-item.sub2 {
    padding-left: 43px;
    font-size: 0.78rem;
    color: var(--text-secondary, #a1a1aa);
}
.nt-tree-item.sub2::before { content: '└'; margin-right: 6px; opacity: 0.45; }
.nt-drop-over {
    outline: 2px dashed var(--c, #8b5cf6);
    outline-offset: 3px;
    transform: scale(1.02);
}

/* ostrzeżenie: aplikacja otwarta w dwóch kartach (storage.js) */
.mt-tabs-warn {
    position: fixed;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    z-index: 20000;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: min(760px, calc(100vw - 24px));
    padding: 12px 14px 12px 16px;
    border: 1px solid rgba(245, 158, 11, 0.55);
    border-radius: 12px;
    background: #2a1f0b;
    color: #fde9c2;
    font-size: 0.86rem;
    line-height: 1.45;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.mt-tabs-warn b { color: #fbbf24; }
.mt-tabs-warn button {
    flex: none;
    padding: 7px 12px;
    border: 0;
    border-radius: 8px;
    background: #f59e0b;
    color: #1a1204;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* Konto: okna blokujące (limit urządzeń, zgody) */
.konto-okno { z-index: 10400; }
.konto-okno .modal-content { width: 440px; max-width: calc(100vw - 32px); }
.konto-okno h3 { margin: 0 0 10px; font-size: 1.1rem; }
.konto-txt { margin: 0 0 14px; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; }
.konto-urz { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.konto-urz li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 10px; }
.konto-urz li span { display: flex; flex-direction: column; min-width: 0; }
.konto-urz li em { color: var(--text-secondary); font-size: 0.78rem; font-style: normal; }
.konto-urz .modal-confirm-btn { flex: none; padding: 7px 12px; font-size: 0.82rem; }
.konto-zgoda { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; font-size: 0.9rem; line-height: 1.5; cursor: pointer; }
.konto-zgoda input { margin-top: 3px; width: 17px; height: 17px; flex: none; accent-color: #8b5cf6; }
.konto-zgoda a { color: #a78bfa; }
.konto-err { margin: -6px 0 12px; color: #fca5a5; font-size: 0.85rem; }

/* ---------- synchronizacja z kontem (js/sync.js) ---------- */
.sm-sync { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin: -8px 0 16px; padding: 0 4px; color: var(--text-secondary); font-size: 0.78rem; line-height: 1.4; }
.sm-sync[hidden] { display: none; }
.sm-sync-txt { flex: 1 1 60%; min-width: 0; }
.sm-sync-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.sm-sync-dot.zapis { background: #a78bfa; animation: smSyncPulse 1.1s ease-in-out infinite; }
.sm-sync-dot.offline, .sm-sync-dot.brak, .sm-sync-dot.nowe { background: #f59e0b; }
.sm-sync-dot.blad, .sm-sync-dot.zaduze, .sm-sync-dot.wylogowane { background: #ef4444; }
.sm-sync button { flex: none; padding: 3px 9px; border: 1px solid var(--glass-border); border-radius: 999px; background: transparent; color: var(--text-main); font: inherit; cursor: pointer; }
.sm-sync button:hover { background: var(--glass-bg); }
@keyframes smSyncPulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .sm-sync-dot.zapis { animation: none; } }

.sync-brama { position: fixed; inset: 0; z-index: 10200; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg-body, #0d0d0f); }
.sync-brama-box { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 420px; text-align: center; }
.sync-brama-box img { animation: syncBramaBob 1.6s ease-in-out infinite; }
.sync-brama-txt { margin: 0; color: var(--text-main); font-size: 1rem; line-height: 1.5; }
.sync-brama-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sync-brama-btns[hidden] { display: none; }
@keyframes syncBramaBob { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .sync-brama-box img { animation: none; } }
.sync-wybor li em { white-space: normal; }

/* ---------- ekran „Wybierz pakiet” i pasek po końcu dostępu (js/konto.js, js/pakiety.js) ---------- */
.pakiet-brama { position: fixed; inset: 0; z-index: 10250; overflow-y: auto; display: flex; justify-content: center; align-items: flex-start; padding: 32px 16px; background: var(--bg-body, #0d0d0f); }
.pb-box { position: relative; width: 100%; max-width: 760px; margin: auto; text-align: center; color: var(--text-main); }
.pb-box > img { display: block; margin: 0 auto 6px; }
.pb-box h2 { margin: 4px 0 8px; font-size: 1.7rem; letter-spacing: -0.01em; }
.pb-sub { margin: 0 auto 22px; max-width: 520px; color: var(--text-secondary); line-height: 1.5; }
.pb-x { position: absolute; top: -8px; right: 0; width: 38px; height: 38px; border: 1px solid var(--glass-border); border-radius: 50%; background: transparent; color: var(--text-secondary); font-size: 1rem; cursor: pointer; }
.pb-x:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.06); }
.pb-plany { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; text-align: left; }
.pb-plan { position: relative; display: flex; flex-direction: column; padding: 22px 20px 18px; border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 18px; background: rgba(255, 255, 255, 0.03); }
.pb-plan.best { border-color: rgba(139, 92, 246, 0.55); background: linear-gradient(180deg, rgba(139, 92, 246, 0.12), rgba(139, 92, 246, 0.03)); box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.15), 0 10px 40px rgba(139, 92, 246, 0.12); }
.pb-badge { position: absolute; top: -11px; left: 18px; padding: 3px 10px; border-radius: 999px; background: var(--accent-gradient); color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; }
.pb-plan h3 { margin: 0; font-size: 1.1rem; }
.pb-cena { margin: 8px 0 2px; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }
.pb-do { margin: 0 0 12px; color: var(--text-secondary); font-size: 0.88rem; }
.pb-plan ul { margin: 0 0 12px; padding: 0; list-style: none; flex: 1; }
.pb-plan li { position: relative; margin: 6px 0; padding-left: 22px; font-size: 0.9rem; line-height: 1.4; }
.pb-plan li::before { content: '✓'; position: absolute; left: 0; color: var(--accent-green, #10b981); font-weight: 700; }
.pb-uwaga { margin: 0 0 12px; color: var(--text-secondary); font-size: 0.8rem; }
.pb-kup { display: block; width: 100%; text-align: center; text-decoration: none; box-sizing: border-box; }
/* Booster: ikonka, nazwa w gradiencie z błyskiem (jak na landingu) i delikatny błysk przechodzący po karcie */
.pb-plan h3 { display: flex; align-items: center; gap: 8px; }
.pk-ikona { flex: none; }
.pb-plan.boost .pk-ikona { filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.35)); }
.pb-grad {
    background-image: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.9) 50%, transparent 62%), linear-gradient(90deg, #a78bfa, #f97316);
    background-size: 260% 100%, 100% 100%; background-position: 130% 0, 0 0; background-repeat: no-repeat;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: pbGradShine 10s cubic-bezier(0.45, 0, 0.25, 1) 1.2s infinite both;
}
@keyframes pbGradShine {
    0% { background-position: 130% 0, 0 0; }
    32%, 100% { background-position: -30% 0, 0 0; }
}
.pb-plan.boost::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.07) 48%, rgba(249, 115, 22, 0.08) 52%, transparent 60%);
    background-size: 250% 100%; background-position: 130% 0; background-repeat: no-repeat;
    animation: pbKartaBlysk 10s cubic-bezier(0.45, 0, 0.25, 1) 1.2s infinite both;
}
@keyframes pbKartaBlysk {
    0% { background-position: 130% 0; }
    34%, 100% { background-position: -30% 0; }
}
.pb-plan.boost .pb-badge { z-index: 1; }
@media (prefers-reduced-motion: reduce) {
    .pb-grad, .pb-plan.boost::after { animation: none; }
}
/* dodatki (np. sama baza zadań) — kafelek pod pakietami */
.pb-dodatki { display: grid; gap: 10px; margin-top: 14px; text-align: left; }
.pb-dodatek { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border: 1px dashed rgba(255, 255, 255, 0.14); border-radius: 16px; background: rgba(255, 255, 255, 0.02); }
.pb-dod-tekst { flex: 1; min-width: 0; }
.pb-dodatek h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 1rem; }
.pb-dod-cena { margin-left: 4px; font-weight: 800; }
.pb-dodatek ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; margin: 8px 0; padding: 0; list-style: none; }
.pb-dodatek li { position: relative; padding-left: 22px; font-size: 0.88rem; line-height: 1.5; }
.pb-dodatek li::before { content: '✓'; position: absolute; left: 0; color: var(--accent-green, #10b981); font-weight: 700; }
.pb-dodatek p { margin: 0 0 4px; font-size: 0.88rem; line-height: 1.4; }
.pb-dodatek .pb-uwaga { margin: 0; }
.pb-dodatek .pb-kup { flex: none; width: auto; min-width: 210px; }
@media (max-width: 600px) {
    .pb-dodatek { flex-direction: column; align-items: stretch; }
    .pb-dodatek ul { grid-template-columns: 1fr; }
    .pb-dodatek .pb-kup { width: 100%; min-width: 0; }
}
.pb-kup[disabled] { opacity: 0.7; cursor: default; }
.pb-kod { margin: 22px auto 0; max-width: 520px; text-align: left; }
.pb-kod label { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: 0.88rem; }
.pb-kod-rz { display: flex; gap: 8px; }
.pb-kod-rz input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 0.05em; }
.pb-kod-rz input::placeholder { text-transform: none; letter-spacing: normal; }
.pb-kod-rz button { flex: none; }
.pb-msg { min-height: 1.4em; margin: 10px auto 0; max-width: 520px; color: var(--text-secondary); font-size: 0.88rem; line-height: 1.45; }
.pb-msg.err { color: #fca5a5; }
.pb-dol { margin: 18px 0 0; color: var(--text-secondary); font-size: 0.82rem; line-height: 1.8; overflow-wrap: anywhere; }
.pb-link { padding: 0; border: 0; background: none; color: var(--text-main); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.pb-link[disabled] { opacity: 0.6; }
@media (max-width: 520px) {
    .pakiet-brama { padding: 24px 16px; }
    .pb-box h2 { font-size: 1.45rem; }
    .pb-kod-rz { flex-direction: column; }
}

.pakiet-pasek { position: sticky; top: 0; z-index: 900; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 12px; padding: 8px 16px; background: rgba(245, 158, 11, 0.14); border-bottom: 1px solid rgba(245, 158, 11, 0.35); color: var(--text-main); font-size: 0.85rem; text-align: center; }
.pakiet-pasek button { padding: 4px 12px; border: 1px solid rgba(245, 158, 11, 0.6); border-radius: 999px; background: transparent; color: var(--text-main); font: inherit; font-weight: 600; cursor: pointer; }
.pakiet-pasek button:hover { background: rgba(245, 158, 11, 0.2); }
