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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Nagłówek */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 40px;
}

h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    opacity: 0.9;
}

/* Selektor zdań */
.sentence-selector {
    padding: 25px 40px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

.sentence-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 15px;
    display:inline-block;
}

.sentence-option {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display:inline-block;
    margin: 5px;
}

.sentence-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.sentence-option.active {
    border-color: #667eea;
    background: #f0f4ff;
}

.sentence-number {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
}

.sentence-text {
    font-size: 14px;
    color: #4a5568;
}

/* Główna zawartość */
.main-content {
    padding: 30px 40px;
}

.current-sentence {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.current-sentence-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #0ea5e9;
    margin-bottom: 8px;
    font-weight: 600;
}

.current-sentence-text {
    font-size: 18px;
    font-weight: 500;
}

/* Panel narzędzi */
.tools-panel {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.tools-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #ea580c;
    margin-bottom: 15px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Przyciski narzędzi */
.tool-btn {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-btn:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.tool-btn.primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
}

.tool-btn.primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.tool-btn.secondary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
}

.tool-btn.secondary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

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

/* Kontener tokenów */
.tokens-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    min-height: 180px;
    align-items: flex-start;
    position: relative;
}

/* Karta tokenu - ZUNIFIKOWANA DEFINICJA */
.token-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    min-width: 180px;
    flex: 0 0 auto;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Kolory dla różnych typów encji - delikatne pastelowe odcienie */
.token-card[data-type="amount"] {
    border-left: 4px solid #93c5fd;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.token-card[data-type="unit"] {
    border-left: 4px solid #a7f3d0;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.token-card[data-type="ingredient"] {
    border-left: 4px solid #fbcfe8;
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
}

.token-card[data-type="conjunction"] {
    border-left: 4px solid #fde68a;
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
}

.token-card[data-type="size"] {
    border-left: 4px solid #c4b5fd;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.token-card[data-type="other"] {
    border-left: 4px solid #d1d5db;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

/* Stany karty tokenu */
.token-card.selected {
    border-color: #4CAF50;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.2);
    transform: translateY(-2px);
}

.token-card.merged {
    border-top: 4px solid #10b981;
}

.token-card.invalid-ingredient {
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    animation: pulse 2s infinite;
}

.token-card:focus-within {
    z-index: 100;
}

/* Nagłówek tokenu */
.token-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.token-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.token-text {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
}

/* Badge'y */
.token-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-merged {
    background: #d1fae5;
    color: #065f46;
}

.type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
}

.type-amount { 
    color: #1565c0;
    background-color: #e3f2fd;
}

.type-unit { 
    color: #7b1fa2;
    background-color: #f3e5f5;
}

.type-ingredient { 
    color: #2e7d32;
    background-color: #e8f5e9;
}

.type-conjunction { 
    color: #ef6c00;
    background-color: #fff3e0;
}

.type-size { 
    color: #00695c;
    background-color: #e0f2f1;
}

.type-other { 
    color: #616161;
    background-color: #f5f5f5;
}

/* Formularze */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}

select, input {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

select:focus, input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Lista składników */
.ingredient-box {
    position: relative;
}

.ingredient-box.active .ingredient-list {
    z-index: 1001;
}

.ingredient-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.ingredient-input.invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.ingredient-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.ingredient-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    position: relative;
    z-index: 1001;
    transition: all 0.2s ease;
}

.ingredient-item:hover {
    background: #3b82f6 !important;
    color: white !important;
}

.ingredient-item:last-child {
    border-bottom: none;
}

/* Przyciski akcji */
.action-buttons {
    display: flex;
    gap: 15px;
    padding: 25px 40px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.btn-save {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.btn-save:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.2);
}

.btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
}

.btn-reset {
    background: white;
    border: 2px solid #e5e7eb;
    color: #4b5563;
}

.btn-reset:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-nav {
    background: white;
    border: 2px solid #3b82f6;
    color: #3b82f6;
    flex: 0.5;
}

.btn-nav:hover {
    background: #3b82f6;
    color: white;
}

/* Pasek statusu */
.status-bar {
    padding: 15px 40px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #64748b;
}

.selected-count {
    font-weight: 600;
    color: #3b82f6;
}

.shortcuts {
    display: flex;
    gap: 20px;
}

.shortcut {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Legenda kolorów */
.color-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #4b5563;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-color-amount { 
    background: #f0f9ff; 
    border-left: 3px solid #93c5fd; 
}

.legend-color-unit { 
    background: #f0fdf4; 
    border-left: 3px solid #a7f3d0; 
}

.legend-color-ingredient { 
    background: #fdf2f8; 
    border-left: 3px solid #fbcfe8; 
}

.legend-color-conjunction { 
    background: #fefce8; 
    border-left: 3px solid #fde68a; 
}

.legend-color-size { 
    background: #f5f3ff; 
    border-left: 3px solid #c4b5fd; 
}
.legend-color-atribute { 
    background: #eaf6a7; 
    border-left: 3px solid #bbdc01; 
}

.legend-color-other { 
    background: #f9fafb; 
    border-left: 3px solid #d1d5db; 
}

/* Elementy skrótów klawiszowych */
kbd {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    font-family: monospace;
    box-shadow: 0 2px 0 #e2e8f0;
}

/* Animacje */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Komunikaty o błędach */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    color: #991b1b;
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
}

.error-message ul {
    margin: 10px 0 0 20px;
}

.error-message li {
    margin-bottom: 5px;
}

/* Responsywność */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 8px;
    }
    
    header, .sentence-selector, .main-content, .action-buttons, .status-bar {
        padding: 20px;
    }
    
    .tokens-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .token-card {
        min-width: 100%;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
    
    .btn {
        min-width: 100%;
    }
    
    .btn-nav {
        flex: 1;
    }
    
    .sentence-options {
        grid-template-columns: 1fr;
        display:inline-block;
    }
    
    .color-legend {
        flex-direction: column;
    }
}

/* Okno modalne ShowWindow */
.show-window-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9998;
    display: none;
    animation: fadeIn 0.3s ease;
}

.show-window-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    /* max-width: 800px; */
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
    overflow: hidden;
    animation: slideIn 0.4s ease;
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to { 
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.show-window-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.show-window-title {
    font-size: 24px;
    font-weight: 600;
}

.show-window-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.show-window-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.show-window-content {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
}

/* Sekcja postępu */
.server-progress-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-container {
    background: #f3f4f6;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.progress-bar {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    border-radius: 6px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #6b7280;
}

.progress-text {
    font-weight: 600;
    color: #10b981;
}

.progress-steps {
    list-style: none;
    margin-top: 16px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.progress-step:last-child {
    border-bottom: none;
}

.step-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step-indicator.completed {
    background: #10b981;
    color: white;
}

.step-indicator.active {
    background: #3b82f6;
    color: white;
}

.step-text {
    flex: 1;
    color: #4b5563;
}

.step-status {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.step-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.step-status.processing {
    background: #dbeafe;
    color: #1e40af;
}

.step-status.completed {
    background: #d1fae5;
    color: #065f46;
}

/* Pole z danymi z serwera */
.server-data-section {
    margin-bottom: 32px;
}

.data-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.data-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

.data-timestamp {
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
}

.data-content {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.json-key {
    color: #059669;
}

.json-string {
    color: #dc2626;
}

.json-number {
    color: #2563eb;
}

.json-boolean {
    color: #7c3aed;
}

.json-null {
    color: #6b7280;
}

/* Statystyki */
.data-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.stat-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Przyciski akcji */
.show-window-actions {
    display: flex;
    gap: 12px;
    padding: 20px 32px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.action-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-secondary {
    background: white;
    /* border: 2px solid #e5e7eb; */
    color: #4b5563;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Responsywność */
@media (max-width: 768px) {
    .show-window-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .show-window-header {
        padding: 20px 24px;
    }
    
    .show-window-content {
        padding: 24px;
    }
    
    .data-stats {
        grid-template-columns: 1fr;
    }
    
    .show-window-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
}

/* Animacje dla postępu */
@keyframes pulseProgress {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.progress-fill.animating {
    animation: pulseProgress 1.5s infinite;
}

/* Notyfikacje */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid #10b981;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-left-color: #10b981;
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.info {
    border-left-color: #3b82f6;
}

.notification-icon {
    font-size: 20px;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.notification-message {
    font-size: 14px;
    color: #6b7280;
}




            .show-window-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); z-index: 9999; display: none; }
            .show-window-container { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); width: 90%; max-width: 800px; max-height: 90vh; display: none; flex-direction: column; z-index: 10000; overflow: hidden; }
            .show-window-header { padding: 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; display: flex; justify-content: space-between; align-items: center; }
            .show-window-title { font-size: 1.5rem; font-weight: 600; }
            .show-window-close { background: none; border: none; color: white; font-size: 2rem; cursor: pointer; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background 0.3s; }
            .show-window-close:hover { background: rgba(255, 255, 255, 0.2); }
            .show-window-content { padding: 20px; overflow-y: auto; flex: 1; }
            .section-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
            .progress-container { background: #f8f9fa; border-radius: 10px; padding: 20px; margin-bottom: 30px; }
            .progress-bar { height: 10px; background: #e9ecef; border-radius: 5px; overflow: hidden; margin-bottom: 10px; }
            .progress-fill { height: 100%; background: linear-gradient(90deg, #667eea, #764ba2); width: 0%; transition: width 0.3s ease; }
            .progress-fill.animating { animation: pulse 1.5s infinite; }
            @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
            .progress-info { display: flex; justify-content: space-between; margin-bottom: 20px; font-size: 0.9rem; }
            .progress-steps { list-style: none; padding: 0; margin: 0; }
            .progress-step { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid #eee; }
            .step-indicator { width: 30px; height: 30px; border-radius: 50%; background: #e9ecef; display: flex; align-items: center; justify-content: center; font-weight: 600; margin-right: 15px; }
            .step-indicator.active { background: #667eea; color: white; }
            .step-indicator.completed { background: #28a745; color: white; }
            .step-text { flex: 1; color: #333; }
            .step-status { font-size: 0.8rem; padding: 4px 10px; border-radius: 15px; }
            .step-status.pending { background: #e9ecef; color: #666; }
            .step-status.processing { background: #fff3cd; color: #856404; }
            .step-status.completed { background: #d4edda; color: #155724; }
            .data-container { background: #f8f9fa; border-radius: 10px; padding: 15px; margin-bottom: 20px; max-height: 250px; overflow-y: auto; font-family: monospace; font-size: 0.85rem; }
            .data-header { display: flex; justify-content: space-between; margin-bottom: 10px; border-bottom: 1px solid #dee2e6; padding-bottom: 5px; }
            .json-key { color: #005cc5; } .json-string { color: #032f62; } .json-number { color: #e36209; } .json-boolean { color: #6f42c1; }
            .data-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
            .stat-item { background: white; border: 1px solid #dee2e6; border-radius: 8px; padding: 10px; text-align: center; }
            .stat-value { font-size: 1.2rem; font-weight: 700; color: #667eea; }
            .stat-label { font-size: 0.7rem; color: #666; text-transform: uppercase; }
            .show-window-actions { padding: 15px 20px; background: #f8f9fa; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid #dee2e6; }
            .action-btn { padding: 10px 20px; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.3s; }
            .btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
            .btn-danger { background: #dc3545; color: white; }
            .notification { position: fixed; top: 20px; right: 20px; background: white; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); padding: 15px; display: flex; gap: 15px; z-index: 10001; animation: slideInRight 0.3s ease; max-width: 350px; }
            @keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
            .notification.success { border-left: 4px solid #28a745; } .notification.error { border-left: 4px solid #dc3545; }


               .ingredient-item.highlighted {
                background-color: #3b82f6;
                color: #7e0101ff;
            }
            .ingredient-item.user-added {
                border-left: 3px solid #10b981;
                background-color: #f0fdf4;
                position: relative;
                transition: all 0.3s ease;
            }
            .ingredient-item.user-added.newly-added {
                animation: highlightNew 2s ease;
                background-color: #d1fae5;
            }
            .user-added-badge {
                font-size: 0.8em;
                color: #047857;
                margin-left: 8px;
                font-style: italic;
            }
            
            /* Efekty dla inputa */
            .ingredient-input.success {
                border-color: #10b981 !important;
                background-color: #f0fdf4 !important;
                transition: all 0.5s ease;
                box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
            }
            
            .ingredient-input.warning {
                border-color: #f59e0b !important;
                background-color: #fffbeb !important;
                transition: all 0.5s ease;
                box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
            }
            
            .ingredient-input.error {
                border-color: #ef4444 !important;
                background-color: #fef2f2 !important;
                transition: all 0.5s ease;
                box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
            }
            
            @keyframes highlightNew {
                0% { background-color: #fef3c7; }
                50% { background-color: #d1fae5; }
                100% { background-color: #f0fdf4; }
            }
            
            .ingredient-added-effect {
                position: absolute;
                background-color: #10b981;
                color: white;
                padding: 4px 8px;
                border-radius: 4px;
                font-size: 0.8em;
                right: 8px;
                top: 50%;
                transform: translateY(-50%);
                animation: slideIn 0.5s ease;
            }
            
            @keyframes slideIn {
                from { opacity: 0; transform: translateY(-50%) translateX(20px); }
                to { opacity: 1; transform: translateY(-50%) translateX(0); }
            }
            
            .input-status-message {
                font-size: 0.85em;
                margin-top: 4px;
                padding: 4px 8px;
                border-radius: 4px;
                display: none;
                animation: fadeIn 0.3s ease;
            }
            
            .input-status-message.success {
                background-color: #d1fae5;
                color: #047857;
                border: 1px solid #a7f3d0;
                display: block;
            }
            
            .input-status-message.warning {
                background-color: #fef3c7;
                color: #92400e;
                border: 1px solid #fde68a;
                display: block;
            }
            
            .input-status-message.error {
                background-color: #fee2e2;
                color: #991b1b;
                border: 1px solid #fecaca;
                display: block;
            }
            
            @keyframes fadeIn {
                from { opacity: 0; transform: translateY(-10px); }
                to { opacity: 1; transform: translateY(0); }
            }
            
            /* Dodane: Style dla modyfikowanych tokenów */
            .token-card.modified {
                border-left: 4px solid #f59e0b;
                background-color: #fffbeb;
            }
            
            .token-card.modified::before {
                content: "●";
                color: #f59e0b;
                position: absolute;
                left: -10px;
                top: 10px;
                font-size: 12px;
            }
            
            .modified-badge {
                font-size: 0.7em;
                background-color: #f59e0b;
                color: white;
                padding: 2px 6px;
                border-radius: 10px;
                margin-left: 8px;
                font-weight: normal;
            }
            
            .merge-indicator {
                font-size: 0.7em;
                background-color: #8b5cf6;
                color: white;
                padding: 2px 6px;
                border-radius: 10px;
                margin-left: 4px;
                font-style: italic;
            }
            
            .split-indicator {
                font-size: 0.7em;
                background-color: #10b981;
                color: white;
                padding: 2px 6px;
                border-radius: 10px;
                margin-left: 4px;
                font-style: italic;
            }
            
            .change-summary {
                margin-top: 10px;
                padding: 10px;
                background-color: #f8fafc;
                border-radius: 6px;
                border-left: 4px solid #3b82f6;
                font-size: 0.9em;
            }
            
            .change-summary h4 {
                margin: 0 0 8px 0;
                color: #1e40af;
            }
            
            .change-item {
                margin: 4px 0;
                padding: 4px;
                border-radius: 4px;
                background-color: #e2e8f0;
            }
            
            .cache-info {
                font-size: 0.8em;
                color: #6b7280;
                margin-top: 5px;
                padding: 3px 6px;
                background-color: #f3f4f6;
                border-radius: 4px;
                display: inline-block;
            }
            
            /* Style dla przycisku zapisz */
            .save-button {
                background-color: #10b981;
                color: white;
                border: none;
                padding: 10px 20px;
                border-radius: 6px;
                cursor: pointer;
                font-weight: bold;
                transition: all 0.3s ease;
                display: flex;
                align-items: center;
                gap: 8px;
                margin-top: 10px;
            }
            
            .save-button:hover {
                background-color: #047857;
                transform: translateY(-2px);
                box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
            }
            
            .save-button:active {
                transform: translateY(0);
            }
            
            .save-button.saving {
                background-color: #f59e0b;
                animation: pulse 1.5s infinite;
            }
            
            .save-button.success {
                background-color: #10b981;
                animation: successFlash 0.5s;
            }
            
            .save-button.error {
                background-color: #ef4444;
            }
            
            @keyframes pulse {
                0% { opacity: 1; }
                50% { opacity: 0.7; }
                100% { opacity: 1; }
            }
            
            @keyframes successFlash {
                0% { background-color: #10b981; }
                50% { background-color: #86efac; }
                100% { background-color: #10b981; }
            }
            
            .save-status {
                margin-top: 10px;
                padding: 8px 12px;
                border-radius: 6px;
                font-size: 0.9em;
                display: none;
            }
            
            .save-status.success {
                background-color: #d1fae5;
                color: #047857;
                border: 1px solid #a7f3d0;
                display: block;
            }
            
            .save-status.error {
                background-color: #fee2e2;
                color: #991b1b;
                border: 1px solid #fecaca;
                display: block;
            }
            
            .save-status.info {
                background-color: #dbeafe;
                color: #1e40af;
                border: 1px solid #93c5fd;
                display: block;
            }




             .show-window-overlay { 
                position: fixed; 
                top: 0; 
                left: 0; 
                right: 0; 
                bottom: 0; 
                background: rgba(0,0,0,0.5); 
                z-index: 9999; 
                display: none; 
            }
            .show-window-container { 
                position: fixed; 
                top: 50%; 
                left: 50%; 
                transform: translate(-50%, -50%); 
                background: white; 
                border-radius: 12px; 
                width: 800px; 
                max-width: 90vw; 
                max-height: 90vh; 
                display: none; 
                flex-direction: column; 
                z-index: 10000; 
                box-shadow: 0 10px 40px rgba(0,0,0,0.2); 
            }
            .progress-step.loading-step .step-indicator {
                background: #f0f0f0;
                color: #666;
            }