* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    color: #d4b896;
    min-height: 100vh;
    padding: clamp(16px, 3vw, 32px);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(42, 42, 42, 0.95);
    border-radius: 16px;
    padding: clamp(24px, 5vw, 48px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* Page header with title and share button */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(32px, 6vw, 56px);
    padding-bottom: clamp(16px, 3vw, 24px);
    border-bottom: 2px solid rgba(139, 115, 85, 0.3);
    flex-wrap: wrap;
    gap: 20px;
}

h1 {
    color: #f4e4c1;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    letter-spacing: 1px;
    margin: 0;
    flex: 1;
    text-align: left;
    font-weight: 700;
}

/* Share button styling */
.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid #555;
    border-radius: 10px;
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    color: #d4b896;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    min-height: 48px;
    white-space: nowrap;
}

.share-btn:hover {
    border-color: #8b7355;
    background: linear-gradient(145deg, #4a3a2a, #3a2a1a);
    color: #f4e4c1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.share-icon {
    font-size: 18px;
}

.share-text {
    font-size: 16px;
}

h2 {
    color: #e6d7bb;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    margin-bottom: clamp(16px, 3vw, 24px);
    border-bottom: 2px solid #8b7355;
    padding-bottom: 10px;
    font-weight: 600;
}

h3 {
    color: #e6d7bb;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    margin-bottom: 15px;
    font-weight: 600;
}

h4 {
    color: #d4b896;
    font-size: clamp(1rem, 2vw, 1.1rem);
    margin-bottom: 10px;
    font-weight: 600;
}

/* Mode selection */
.mode-selection {
    margin-bottom: clamp(32px, 6vw, 48px);
    text-align: center;
}

.mode-header {
    color: #e6d7bb;
    font-size: clamp(1.2rem, 2.5vw, 1.4rem);
    margin-bottom: clamp(16px, 3vw, 24px);
    font-weight: 600;
    border-bottom: none;
    padding-bottom: 0;
}

.mode-buttons {
    display: inline-flex;
    background: #2a2a2a;
    border: 2px solid #555;
    border-radius: 12px;
    padding: 6px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
}

.mode-btn {
    padding: clamp(12px, 2vw, 16px) clamp(24px, 4vw, 32px);
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #a0a0a0;
    font-size: clamp(14px, 2vw, 16px);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    position: relative;
    z-index: 2;
    min-width: clamp(140px, 20vw, 160px);
    text-align: center;
}

.mode-btn:hover {
    color: #d4b896;
}

.mode-btn.active {
    background: linear-gradient(145deg, #8b7355, #6a5a42);
    color: #f4e4c1;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(139, 115, 85, 0.3);
    transform: translateY(-1px);
}

/* Mode button content styling */
.mode-icon {
    display: block;
    font-size: clamp(18px, 3vw, 20px);
    margin-bottom: 4px;
    line-height: 1;
}

.mode-text {
    display: block;
    font-size: clamp(12px, 2vw, 14px);
    line-height: 1.2;
}

/* Input section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 4vw, 32px);
    margin: 0 auto clamp(32px, 6vw, 48px);
    max-width: 600px;
    padding: clamp(20px, 4vw, 32px);
    background: rgba(30, 30, 30, 0.5);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group.max-only {
    max-width: 100%;
    display: flex;  /* Show by default since we start in max mode */
}

.input-group.target-only {
    max-width: 100%;
    display: none;  /* Hide by default since we start in max mode */
}

/* Refinery options styling */
.refinery-options {
    margin-top: 0;
    padding: clamp(16px, 3vw, 20px);
    background: rgba(20, 20, 20, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #e6d7bb;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

input[type="text"], input[type="number"] {
    padding: clamp(14px, 3vw, 18px) clamp(16px, 3vw, 20px);
    border: 2px solid #555;
    border-radius: 12px;
    background: linear-gradient(145deg, #2a2a2a, #333);
    color: #f4e4c1;
    font-size: clamp(16px, 3vw, 18px);
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    min-height: clamp(52px, 8vw, 56px);
    width: 100%;
}

input[type="text"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: #8b7355;
    background: linear-gradient(145deg, #3a3a3a, #444);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(139, 115, 85, 0.4),
        0 0 30px rgba(139, 115, 85, 0.1);
    transform: translateY(-1px);
}

input[type="text"]::placeholder, input[type="number"]::placeholder {
    color: #888;
    font-weight: normal;
    letter-spacing: normal;
}

input[type="text"]:valid, input[type="number"]:valid {
    border-color: #4a8b3a;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(74, 139, 58, 0.2);
}

/* Remove number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Input animations */
.input-group {
    position: relative;
}

.input-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #8b7355, #f4e4c1, #8b7355);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.input-group:focus-within::after {
    width: 100%;
}

/* Animated typing effect */
input[type="text"].typing, input[type="number"].typing {
    animation: pulse 0.3s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Number formatting visual cues */
input[type="text"]:not(:placeholder-shown), input[type="number"]:not(:placeholder-shown) {
    background: linear-gradient(145deg, #1a3a1a, #2a4a2a);
    border-color: #4a8b3a;
}

/* Large number display enhancement */
input[type="text"][data-large], input[type="number"][data-large] {
    font-size: clamp(18px, 3.5vw, 22px);
    color: #f4e4c1;
    text-shadow: 0 0 8px rgba(244, 228, 193, 0.3);
}

/* Mode sections */
.max-mode-section {
    display: block;  /* Show by default since we start in max mode */
    margin-bottom: clamp(32px, 6vw, 48px);
    text-align: center;
}

.target-mode-section {
    display: none;  /* Hide by default */
    margin-bottom: clamp(32px, 6vw, 48px);
    text-align: center;
}

.max-mode-section.active {
    display: block;
}

.target-mode-section.active {
    display: block;
}

.mode-description {
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    color: #c4a373;
    margin: 0 auto clamp(24px, 4vw, 32px);
    padding: clamp(16px, 3vw, 20px);
    background: rgba(196, 163, 115, 0.1);
    border-radius: 12px;
    border-left: 4px solid #8b7355;
    font-style: italic;
    max-width: 600px;
    line-height: 1.6;
}

/* Recommendations section */
.recommendations-section {
    margin: 0;
    width: 100%;
}

.recommendation-card {
    background: linear-gradient(135deg, rgba(30, 30, 35, 0.98) 0%, rgba(25, 25, 30, 0.98) 100%);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: none;  /* Hidden by default until there's data */
}

.recommendation-card.has-data {
    display: block;  /* Show when there's data */
}

.recommendation-card.active {
    border-color: #8b7355;
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(139, 115, 85, 0.3);
    transform: translateY(-2px);
}

.rec-result {
    background: rgba(20, 20, 20, 0.6);
    border-radius: 12px;
    padding: clamp(16px, 3vw, 24px);
    color: #f4e4c1;
    font-weight: 600;
    font-size: clamp(0.9rem, 2vw, 1rem);
    line-height: 1.5;
    min-height: clamp(60px, 10vw, 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.details-toggle {
    margin-top: clamp(16px, 3vw, 20px);
}

.details-button {
    background: linear-gradient(145deg, #4a4a4a, #3a3a3a);
    border: 1px solid #666;
    border-radius: 8px;
    color: #d4b896;
    padding: clamp(8px, 2vw, 12px) clamp(16px, 3vw, 20px);
    cursor: pointer;
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    transition: all 0.3s ease;
    font-weight: 500;
}

.details-button:hover {
    background: linear-gradient(145deg, #5a5a5a, #4a4a4a);
    border-color: #8b7355;
    transform: translateY(-1px);
}

.recommendation-details {
    margin-top: clamp(16px, 3vw, 20px);
    padding: clamp(16px, 3vw, 20px);
    background: rgba(20, 20, 20, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: clamp(12px, 2vw, 16px);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(8px, 1.5vw, 10px) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-label {
    color: #b8a082;
    font-weight: 500;
    font-size: clamp(0.85rem, 1.8vw, 0.9rem);
}

.detail-value {
    color: #f4e4c1;
    font-weight: 600;
    font-size: clamp(0.85rem, 1.8vw, 0.9rem);
}

.efficiency-hint {
    color: #8b7355;
    cursor: pointer;
    font-size: clamp(0.8rem, 1.6vw, 0.9rem);
    margin-left: 5px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.efficiency-hint:hover {
    color: #f4e4c1;
    transform: scale(1.1);
}

.efficiency-explanation {
    margin-top: clamp(16px, 3vw, 20px);
    padding: clamp(16px, 3vw, 20px);
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 12px;
    border: 1px solid #555;
    border-left: 4px solid #8b7355;
}

.explanation-content h4 {
    color: #f4e4c1;
    margin-bottom: clamp(8px, 2vw, 12px);
    font-size: clamp(1rem, 2.2vw, 1.1rem);
}

.explanation-content p {
    color: #d4b896;
    margin-bottom: clamp(6px, 1.5vw, 8px);
    line-height: 1.5;
    font-size: clamp(0.85rem, 1.8vw, 0.9rem);
}

.explanation-content p:last-child {
    margin-bottom: 0;
}

/* Raw data section */
.raw-data-section {
    margin-top: clamp(32px, 6vw, 48px);
    text-align: center;
}

.raw-data-button {
    background: linear-gradient(145deg, #4a4a4a, #3a3a3a);
    border: 1px solid #666;
    border-radius: 8px;
    color: #d4b896;
    padding: clamp(12px, 2.5vw, 16px) clamp(20px, 4vw, 24px);
    cursor: pointer;
    font-size: clamp(0.9rem, 2vw, 1rem);
    transition: all 0.3s ease;
    margin-bottom: clamp(16px, 3vw, 20px);
    font-weight: 500;
}

.raw-data-button:hover {
    background: linear-gradient(145deg, #5a5a5a, #4a4a4a);
    border-color: #8b7355;
    transform: translateY(-1px);
}

.raw-data-table {
    margin-top: clamp(16px, 3vw, 20px);
    padding: clamp(16px, 3vw, 24px);
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 16px;
    border: 1px solid #555;
    overflow-x: auto;
}

.raw-data-table h4 {
    color: #f4e4c1;
    margin-bottom: clamp(12px, 2.5vw, 16px);
    font-size: clamp(1.1rem, 2.5vw, 1.2rem);
}

.refinery-table {
    width: 100%;
    border-collapse: collapse;
    color: #d4b896;
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    min-width: 600px;
}

.refinery-table th {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    color: #f4e4c1;
    padding: clamp(10px, 2vw, 12px) clamp(6px, 1.5vw, 8px);
    text-align: left;
    border: 1px solid #555;
    font-weight: 600;
    font-size: clamp(0.75rem, 1.6vw, 0.85rem);
}

.refinery-table td {
    padding: clamp(8px, 1.8vw, 10px) clamp(6px, 1.5vw, 8px);
    border: 1px solid #444;
    text-align: left;
}

.refinery-table tr:nth-child(even) {
    background: rgba(42, 42, 42, 0.3);
}

.refinery-table tr:hover {
    background: rgba(139, 115, 85, 0.1);
}

.refinery-table .best-efficiency {
    background: rgba(139, 115, 85, 0.2) !important;
}

.refinery-table .best-efficiency:hover {
    background: rgba(139, 115, 85, 0.3) !important;
}

/* Toggle controls for mixed refineries */
.toggle-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: #d4b896;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.toggle-label input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
    accent-color: #8b7355;
}

.toggle-text {
    display: flex;
    align-items: center;
    font-weight: bold;
    margin-bottom: 4px;
}

.toggle-hint {
    font-size: clamp(0.8rem, 1.8vw, 0.85rem);
    color: #a0a0a0;
    font-style: italic;
    text-align: center;
}

.toggle-label:hover .toggle-text {
    color: #f4e4c1;
}

.toggle-label:hover .toggle-hint {
    color: #c0c0c0;
}

/* Responsive design improvements */
@media (min-width: 768px) {
    .page-header {
        flex-wrap: nowrap;
    }
    
    .input-section {
        max-width: 500px;
    }
    
    .details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 48px 64px;
    }
    
    .input-section {
        padding: 40px;
        max-width: 500px;
    }
    
    .recommendation-card {
        padding: 40px;
    }
    
    .raw-data-table {
        padding: 32px;
    }
    
    .refinery-table {
        min-width: auto;
    }
    
    .details-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .mode-btn {
        padding: 12px 16px;
        min-width: 120px;
    }
    
    .mode-icon {
        font-size: 18px;
        margin-bottom: 3px;
    }
    
    .mode-text {
        font-size: 12px;
    }
    
    .mode-buttons {
        padding: 3px;
    }
    
    .share-btn {
        padding: 10px 16px;
        min-height: 44px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   INLINE STYLES FROM HTML
   ============================================ */

.share-section {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0 1rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #2a4a1a, #1a3a0a);
    border: 1px solid #4a8b3a;
    border-radius: 6px;
    color: #d4b896;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.share-btn:hover {
    background: linear-gradient(135deg, #3a5a2a, #2a4a1a);
    border-color: #5a9b4a;
    transform: translateY(-1px);
}

.share-icon {
    font-size: 0.9rem;
}

.share-text {
    font-size: 0.85rem;
}

/* Compact Header Override */
.page-header {
    margin-bottom: 1.5rem !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    justify-content: center !important;
}

h1 {
    font-size: 1.4rem !important;
    margin: 0 !important;
    text-align: center;
    color: #d4af37;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Compact Raw Data Section */
.raw-data-section {
    margin-top: 1rem;
    text-align: center;
}

.raw-data-button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.breakdown-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.breakdown-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.detail-icon {
    width: 1.2rem;
    text-align: center;
}

.refinery-breakdown {
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(30, 30, 35, 0.95) 0%, rgba(25, 25, 30, 0.95) 100%);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.breakdown-header-section {
    text-align: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    margin-bottom: 0.75rem;
}

.breakdown-title {
    color: #d4af37;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
    text-align: center;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.breakdown-item {
    text-align: center;
    background: linear-gradient(135deg, rgba(40, 40, 45, 0.6) 0%, rgba(35, 35, 40, 0.6) 100%);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(212, 175, 55, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.breakdown-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: rgba(212, 175, 55, 0.2);
}

.breakdown-header {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.breakdown-summary {
    font-size: 0.85rem;
    color: #d4af37;
    font-weight: 500;
}

.breakdown-line {
    margin: 0.2rem 0;
    line-height: 1.3;
}

/* Compact Efficiency Layout */
.efficiency-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.efficiency-label {
    font-size: 0.9rem;
    color: #ccc;
}

.efficiency-value {
    font-weight: bold;
    color: #d4af37;
}

.efficiency-hint {
    color: #8b7355;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 0.2rem;
    border-radius: 3px;
}

.efficiency-hint:hover {
    color: #f4e4c1;
    background: rgba(255, 255, 255, 0.1);
}

.refinery-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #d4af37;
}

.summary-header {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #d4af37;
}

.formula-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(30, 30, 35, 0.95) 0%, rgba(25, 25, 30, 0.95) 100%);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.formula-header-section {
    text-align: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    margin-bottom: 0.75rem;
}

.formula-title {
    color: #d4af37;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
    text-align: center;
}

.formula-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.formula-outputs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid rgba(212, 175, 55, 0.3);
}

.formula-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(40, 40, 45, 0.6) 0%, rgba(35, 35, 40, 0.6) 100%);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.formula-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(212, 175, 55, 0.25);
}

.formula-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(212, 175, 55, 0.04) 100%);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.formula-result:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border-color: rgba(212, 175, 55, 0.35);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(212, 175, 55, 0.06) 100%);
}

/* Arrow indicator removed for cleaner design */

.formula-icon {
    font-size: 1.5rem;
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin: 0 4px;
}

.detail-icon-img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.formula-value {
    font-weight: bold;
    font-size: 1rem;
    color: #f4e4c1;
}

.formula-result .formula-value {
    font-size: 1.3rem;
    color: #d4af37;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.formula-label {
    font-size: 0.9rem;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.formula-result .formula-label {
    color: #d4af37;
    font-weight: 600;
}

.no-calculation {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 2rem;
}

/* Enhanced Efficiency Display */
.efficiency-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.efficiency-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.efficiency-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ffaa00, #44ff44);
    border-radius: 4px;
    transition: width 0.8s ease-out;
    width: 0%;
}

.efficiency-rating {
    font-size: 0.9rem;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    min-width: 60px;
    text-align: center;
}

.efficiency-rating.poor {
    background: rgba(255, 68, 68, 0.2);
    color: #ffffff;
    border: 1px solid #ff4444;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.efficiency-rating.fair {
    background: rgba(255, 152, 0, 0.2);
    color: #ffffff;
    border: 1px solid #ff9800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.efficiency-rating.good {
    background: rgba(76, 175, 80, 0.2);
    color: #ffffff;
    border: 1px solid #4caf50;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.efficiency-rating.excellent {
    background: rgba(46, 125, 50, 0.2);
    color: #ffffff;
    border: 1px solid #2e7d32;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Refinery Comparison */
.refinery-comparison {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(30, 30, 35, 0.95) 0%, rgba(25, 25, 30, 0.95) 100%);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.refinery-specs-header {
    text-align: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    margin-bottom: 1rem;
}

.specs-title {
    color: #d4af37;
    font-size: 1rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.comparison-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comparison-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.refinery-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.refinery-icon {
    font-size: 1.2rem;
}

.refinery-label {
    font-size: 0.9rem;
    color: #d4af37;
    font-weight: 600;
}

.refinery-specs {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.spec-label {
    color: #bbb;
    font-weight: 500;
}

.spec-value {
    color: #f4e4c1;
    font-weight: 600;
}

.spec-value.highlight {
    color: #d4af37;
    font-weight: bold;
}

.efficiency-meter {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease-out;
    position: relative;
}

/* Efficiency-based colors for meter fills */
.meter-fill.small-fill {
    background: linear-gradient(90deg, #ff6b6b, #ff8a80) !important;
}

.meter-fill.medium-fill {
    background: linear-gradient(90deg, #ffa726, #ffb74d) !important;
}

.meter-fill.large-fill,
.meter-fill.optimal {
    background: linear-gradient(90deg, #4caf50, #66bb6a) !important;
}

.meter-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    text-align: center;
}

/* Result Animation */
.formula-display.animate {
    animation: slideInFromBottom 0.5s ease-out;
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.formula-value.counting {
    animation: countUp 0.8s ease-out;
}

@keyframes countUp {
    from {
        transform: scale(0.8);
        opacity: 0.6;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Main Layout Structure */
.main-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.control-panel {
    background: rgba(20, 20, 20, 0.6);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.results-panel {
    min-height: 400px;
    width: 100%;
}

/* Compact Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: #d4af37;
    font-weight: 600;
}

.input-group input {
    padding: 0.75rem 1rem;
    min-height: auto;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: border-color 0.3s ease;
}

.input-group input.valid {
    border-color: #4caf50;
    background-color: rgba(76, 175, 80, 0.05);
}

.input-group input.invalid {
    border-color: #ff4444;
    background-color: rgba(255, 68, 68, 0.05);
}

.input-group input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.input-group input:focus.valid {
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.input-group input:focus.invalid {
    border-color: #ff4444;
    box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.1);
}

/* Compact Mode Selection */
.mode-selection {
    margin-bottom: 0;
    text-align: left;
}

.mode-header {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #f4e4c1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
}

.mode-buttons {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.25rem;
}

.mode-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    min-width: auto;
    font-size: 0.85rem;
}

.mode-text {
    font-size: 0.85rem;
}

.mode-icon {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

/* Compact Refinery Options */
.refinery-options {
    margin-top: 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-label {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.toggle-text {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.toggle-hint {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
}

/* Compact Mode Descriptions */
.mode-descriptions {
    margin-top: 0.75rem;
}

.mode-description {
    font-size: 0.8rem;
    padding: 0.6rem;
    margin: 0;
    border-left: 3px solid #8b7355;
    background: rgba(139, 115, 85, 0.1);
    border-radius: 4px;
    max-width: none;
    line-height: 1.3;
}

/* Results Panel Enhancements */

.recommendation-card {
    margin: 0;
}

/* Mobile adjustments moved to responsive section */

.no-calculation {
    padding: 3rem 2rem;
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.no-calc-icon {
    font-size: 3rem;
    opacity: 0.6;
}

.no-calc-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #d4af37;
}

.no-calc-text {
    font-size: 1rem;
    color: #aaa;
    text-align: center;
    max-width: 300px;
    line-height: 1.5;
}

/* Mobile responsive for new layout */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .control-panel {
        position: static;
        padding: 1.25rem;
    }
    
    .mode-buttons {
        justify-content: center;
    }
    
    .toggle-label {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .efficiency-display {
        padding: 1rem;
    }
    
    .efficiency-metric {
        flex-direction: column;
        gap: 1rem;
    }
    
    .efficiency-scale {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .scale-item {
        padding: 0.5rem;
    }
    
    .scale-range {
        font-size: 0.9rem;
    }
    
    .efficiency-title {
        font-size: 1rem;
    }
    .main-layout {
        gap: 1rem;
    }
    
    .control-panel {
        padding: 1rem;
    }
    
    .mode-btn {
        padding: 0.6rem 0.8rem;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .efficiency-display {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .efficiency-bar {
        order: 2;
    }
    
    .efficiency-rating {
        order: 3;
        align-self: center;
    }
    
    .formula-display {
        gap: 1rem;
    }
    
    .formula-inputs {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .formula-outputs {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* Mobile adjustments */
}

/* ============================================
   NEW FEATURES STYLES
   ============================================ */


/* Calculation History */
.history-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: rgba(42, 42, 42, 0.98);
    border-left: 2px solid #8b7355;
    padding: 2rem;
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 999;
}

.history-panel.open {
    right: 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #8b7355;
}

.history-close {
    background: none;
    border: none;
    color: #d4b896;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.history-close:hover {
    transform: rotate(90deg);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(139, 115, 85, 0.2);
    transform: translateX(-5px);
}

.history-timestamp {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.history-summary {
    font-size: 0.9rem;
    color: #d4b896;
}

.history-details {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

/* History Toggle Button */
.history-toggle {
    position: fixed;
    right: 20px;
    top: 20px;  /* Now at the top since theme toggle is removed */
    background: rgba(42, 42, 42, 0.9);
    border: 2px solid #8b7355;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #d4b896;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 998;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-toggle:hover {
    background: rgba(139, 115, 85, 0.3);
    transform: translateX(-5px);
}

.history-badge {
    background: #8b7355;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Preset Templates */
.presets-section {
    margin-bottom: 1.5rem;
}

.presets-header {
    font-size: 0.9rem;
    color: #d4af37;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.preset-btn {
    background: rgba(20, 20, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.5rem;
    color: #d4b896;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    text-align: center;
}

.preset-btn:hover {
    background: rgba(139, 115, 85, 0.2);
    border-color: #8b7355;
    transform: translateY(-2px);
}

.preset-icon {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.preset-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Export Options */
.export-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.export-btn {
    background: rgba(74, 139, 58, 0.2);
    border: 1px solid #4a8b3a;
    border-radius: 6px;
    color: #d4b896;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.export-btn:hover {
    background: rgba(74, 139, 58, 0.3);
    transform: translateY(-1px);
}

/* Efficiency Display */
.efficiency-display {
    margin: 1.5rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(30, 30, 35, 0.95) 0%, rgba(25, 25, 30, 0.95) 100%);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.efficiency-header-section {
    text-align: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    margin-bottom: 1rem;
}

.efficiency-title {
    color: #d4af37;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
    text-align: center;
}

.efficiency-metric {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.efficiency-gauge {
    position: relative;
    width: 80px;
    height: 80px;
}

.gauge-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.gauge-background {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.gauge-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-in-out;
}

.gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #d4af37;
}

.gauge-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.efficiency-rating {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    min-width: 120px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.efficiency-rating.excellent {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.efficiency-rating.good {
    color: #ffaa00;
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid rgba(255, 170, 0, 0.3);
}

.efficiency-rating.fair {
    color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.efficiency-rating.poor {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

/* Efficiency hint button removed - explanation always visible */

/* Efficiency explanation integrated into main display */

.efficiency-scale-section {
    margin-top: 1rem;
}

.efficiency-scale {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.scale-item {
    padding: 0.5rem 0.25rem;
    border-radius: 6px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scale-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.scale-item.excellent {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
}

.scale-item.good {
    background: rgba(255, 170, 0, 0.1);
    border-color: rgba(255, 170, 0, 0.3);
}

.scale-item.fair {
    background: rgba(255, 152, 0, 0.1);
    border-color: rgba(255, 152, 0, 0.3);
}

.scale-item.poor {
    background: rgba(255, 68, 68, 0.1);
    border-color: rgba(255, 68, 68, 0.3);
}

.scale-range {
    display: block;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.scale-item.excellent .scale-range { color: #4caf50; }
.scale-item.good .scale-range { color: #ffaa00; }
.scale-item.fair .scale-range { color: #ff9800; }
.scale-item.poor .scale-range { color: #ff4444; }

.scale-label {
    display: block;
    font-size: 0.85rem;
    color: #ccc;
}

.efficiency-note {
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
    margin: 0;
    text-align: center;
    padding-top: 0.75rem;
}

/* ROI Calculator removed - not applicable for this game */

/* Comparison Mode */
.comparison-mode {
    display: none;
}

.comparison-mode.active {
    display: block;
}

.comparison-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comparison-add {
    background: rgba(74, 139, 58, 0.2);
    border: 1px solid #4a8b3a;
    border-radius: 6px;
    color: #d4b896;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.comparison-add:hover {
    background: rgba(74, 139, 58, 0.3);
    transform: translateY(-1px);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.comparison-table th {
    background: rgba(139, 115, 85, 0.2);
    color: #f4e4c1;
    padding: 0.75rem;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.comparison-table td {
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

.comparison-table tr:nth-child(even) {
    background: rgba(20, 20, 20, 0.3);
}

.comparison-table .best-value {
    background: rgba(74, 139, 58, 0.2);
    font-weight: bold;
}

/* Touch Gesture Indicator */
.swipe-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(42, 42, 42, 0.9);
    border: 1px solid #8b7355;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: #d4b896;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.swipe-indicator.show {
    opacity: 1;
}

/* Enhanced Error Messages */
.error-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 68, 68, 0.9);
    border: 2px solid #ff4444;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    color: #ffffff;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1001;
    max-width: 400px;
}

.error-toast.show {
    opacity: 1;
}

.success-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(76, 175, 80, 0.9);
    border: 2px solid #4caf50;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    color: #ffffff;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1001;
    max-width: 400px;
}

.success-toast.show {
    opacity: 1;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #8b7355;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1002;
    display: none;
}

.loading-spinner.active {
    display: block;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Accessibility Improvements */
.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;
}

.focus-visible {
    outline: 2px solid #8b7355;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #8b7355;
    color: #ffffff;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 1003;
}

.skip-to-content:focus {
    top: 0;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    body {
        background: #000000;
        color: #ffffff;
    }
    
    .container {
        background: #000000;
        border: 2px solid #ffffff;
    }
    
    input[type="text"],
    input[type="number"] {
        background: #000000;
        color: #ffffff;
        border: 2px solid #ffffff;
    }
}

/* ============================================
   ADDITIONAL STYLES FOR NEW FEATURES
   ============================================ */

/* Validation icons removed - using border colors for feedback */

input.validation-error {
    border-color: #ff4444 !important;
    box-shadow: 0 0 5px rgba(255, 68, 68, 0.3);
}

input.validation-success {
    border-color: #4caf50 !important;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

/* History Panel Additions */
.history-empty {
    text-align: center;
    padding: 2rem;
    color: #888;
}

.history-empty p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.history-empty small {
    font-size: 0.9rem;
    color: #666;
}

.history-detail-row {
    display: flex;
    justify-content: space-between;
    margin: 0.25rem 0;
    font-size: 0.85rem;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.history-load,
.history-delete {
    background: rgba(139, 115, 85, 0.2);
    border: 1px solid #8b7355;
    border-radius: 4px;
    color: #d4b896;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.history-load:hover,
.history-delete:hover {
    background: rgba(139, 115, 85, 0.3);
    transform: translateY(-1px);
}

.history-clear-all {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid #ff4444;
    border-radius: 6px;
    color: #f4e4c1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-clear-all:hover {
    background: rgba(255, 68, 68, 0.3);
    transform: translateY(-1px);
}

/* Comparison Cards for Mobile */
.comparison-cards {
    display: grid;
    gap: 1rem;
}

.comparison-card {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
}

.comparison-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-mode-badge {
    font-size: 0.9rem;
    font-weight: 600;
    color: #d4af37;
}

.comparison-card-body {
    display: grid;
    gap: 0.5rem;
}

.comparison-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.stat-label {
    color: #888;
}

.stat-value {
    color: #f4e4c1;
    font-weight: 600;
}

.comparison-card-footer {
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-load {
    width: 100%;
    padding: 0.5rem;
    background: rgba(74, 139, 58, 0.2);
    border: 1px solid #4a8b3a;
    border-radius: 4px;
    color: #d4b896;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comparison-load:hover {
    background: rgba(74, 139, 58, 0.3);
    transform: translateY(-1px);
}

.comparison-remove {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.comparison-remove:hover {
    transform: scale(1.2);
}

.comparison-empty {
    text-align: center;
    padding: 2rem;
    color: #888;
    font-style: italic;
}

.comparison-clear {
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid #ff4444;
    border-radius: 6px;
    color: #d4b896;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.comparison-clear:hover {
    background: rgba(255, 68, 68, 0.3);
    transform: translateY(-1px);
}

.comparison-toggle {
    background: rgba(42, 42, 42, 0.6);
    border: 1px solid #8b7355;
    border-radius: 6px;
    color: #d4b896;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.comparison-toggle:hover {
    background: rgba(139, 115, 85, 0.3);
    transform: translateY(-1px);
}

/* Embed Mode Styles */
body.embed-mode {
    padding: 0;
    min-height: auto;
}

body.embed-mode .container {
    max-width: 100%;
    border-radius: 0;
    margin: 0;
    padding: 1rem;
}

body.embed-mode .page-header {
    display: none;
}

/* Circular Gauge Stroke Colors */
.gauge-progress {
    stroke: #d4af37;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease-in-out, stroke 0.3s ease;
}

/* Animation for initial load */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recommendation-card {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive adjustments for new features */
@media (max-width: 480px) {
    .history-panel {
        width: 100%;
        right: -100%;
    }
    
    .comparison-table {
        font-size: 0.75rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .presets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

