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

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

.container {
    max-width: 480px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    text-align: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tagline {
    font-size: 13px;
    opacity: 0.9;
}

.tagline a {
    color: #ffd700;
    text-decoration: none;
    font-weight: 500;
}

.content {
    padding: 10px 20px;
}

.section {
    margin-bottom: 15px;
}

.section:last-child {
    margin-bottom: 0;
}

.price-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 15px;
    font-weight: 600;
    color: #4a5568;
}

.price-override {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-override label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.price-override input {
    width: 80px;
    padding: 6px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.price-override input:focus {
    outline: none;
    border-color: #667eea;
}

.calc-section {
    margin-bottom: 15px;
}

.calc-title {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
}

.calc-input-row {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.calc-input {
    flex: 1;
    min-width: 120px;
    max-width: 160px;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.calc-input:focus {
    outline: none;
    border-color: #667eea;
}

.toggle-buttons {
    display: flex;
    background: #e2e8f0;
    border-radius: 10px;
    padding: 3px;
}

.toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.result-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.result-table th {
    background: #64748b;
    color: white;
    padding: 8px 6px;
    font-weight: 600;
    font-size: 12px;
}

.result-table td {
    padding: 12px 8px;
    text-align: center;
    font-weight: 500;
}

.ton-cell { background: #e1e9f4; color: #1e3a8a; }
.stars-cell { background: #f4f0d9; color: #b45309; }
.fee20-cell { background: #e6f4ea; color: #14532d; }
.fee33-cell { background: #f4e1e1; color: #991b1b; }

.collapsible {
    margin: 15px 0;
}

.collapse-header {
    background: #f1f5f9;
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
    border: none;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    color: #475569;
}

.collapse-header:hover {
    background: #e2e8f0;
}

.collapse-arrow {
    transition: transform 0.3s;
}

.collapse-arrow.open {
    transform: rotate(180deg);
}

.collapse-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapse-content.open {
    max-height: none;
    padding-top: 10px;
}

.full-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.full-table th {
    background: #64748b;
    color: white;
    padding: 6px 4px;
    font-weight: 600;
    font-size: 11px;
}

.full-table td {
    padding: 4px 4px;
    text-align: center;
    font-weight: 500;
    font-size: 12px;
}

.full-table tr:nth-child(odd) .ton-cell { background: #e1e9f4; }
.full-table tr:nth-child(even) .ton-cell { background: #d4dde8; }
.full-table tr:nth-child(odd) .stars-cell { background: #f4f0d9; }
.full-table tr:nth-child(even) .stars-cell { background: #ebe6c7; }
.full-table tr:nth-child(odd) .fee20-cell { background: #e6f4ea; }
.full-table tr:nth-child(even) .fee20-cell { background: #dae8dd; }
.full-table tr:nth-child(odd) .fee33-cell { background: #f4e1e1; }
.full-table tr:nth-child(even) .fee33-cell { background: #e8d4d4; }

/* Milestone highlighting */
.milestone-row .ton-cell { 
    font-weight: 700; 
    font-size: 13px;
    background: #c9d1ed !important; 
    color: #1e3a8a;
}
.milestone-row .stars-cell { 
    font-weight: 700; 
    font-size: 13px;
    background: #e5dfc2 !important; 
    color: #b45309;
}
.milestone-row .fee20-cell { 
    font-weight: 700; 
    font-size: 13px;
    background: #cde0d1 !important; 
    color: #14532d;
}
.milestone-row .fee33-cell { 
    font-weight: 700; 
    font-size: 13px;
    background: #e0c8c8 !important; 
    color: #991b1b;
}

.help-text {
    background: #f0f9ff;
    padding: 12px;
    border-radius: 6px;
    font-size: 15px;
    color: #0f172a;
    line-height: 1.5;
    margin: 15px 0 0 0;
}

.footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    margin-top: 20px;
}

.footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.footer a:hover {
    text-decoration: underline;
}

.logo {
    height: 26px;
    width: auto;
    margin-right: 4px;
    vertical-align: middle;
}

.status {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
}

.error {
    color: #dc2626;
}

@media (max-width: 480px) {
    body {
        padding: 0;
        background: white;
    }
    
    .container {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        max-width: none;
    }
    
    .header {
        padding: 15px 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .price-row {
        flex-wrap: nowrap;
        gap: 10px;
        justify-content: center;
    }
    
    .current-price {
        font-size: 14px;
        flex-shrink: 0;
    }
    
    .price-override {
        gap: 5px;
    }
    
    .price-override label {
        font-size: 13px;
    }
    
    .price-override input {
        width: 70px;
        padding: 5px 8px;
        font-size: 13px;
    }
    
    .calc-input-row {
        align-items: stretch;
        gap: 10px;
    }
    
    .calc-title {
        width: 100%;
        margin-right: 0;
        align-self: flex-start;
    }
    
    .calc-input {
        flex: 1;
        min-width: 0;
        max-width: none;
        height: 44px;
    }
    
    .toggle-buttons {
        align-self: flex-start;
        height: 44px;
        align-items: center;
    }
    
    .toggle-btn {
        padding: 10px 14px;
        height: 38px;
        display: flex;
        align-items: center;
    }
}