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

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
}

.header {
    text-align: center;
    padding: 2rem 1rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1d1d1f;
}

.subtitle {
    font-size: 0.95rem;
    color: #86868b;
    margin-top: 0.25rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.25rem;
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 1.25rem;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.badge {
    font-size: 0.75rem;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-weight: 500;
}

.card-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.storage-toggles,
.condition-toggles {
    display: flex;
    gap: 0.35rem;
}

.toggle {
    font-size: 0.8rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    background: #fff;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.15s;
}

.toggle:hover {
    background: #f0f0f5;
    color: #0071e3;
}

.toggle-active {
    background: #0071e3;
    color: #fff;
    border-color: #0071e3;
}

.card-price {
    text-align: center;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
}

.price-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1d1d1f;
}

.price-currency {
    font-size: 1rem;
    color: #86868b;
    margin-left: 0.25rem;
}

.price-label {
    display: block;
    font-size: 0.8rem;
    color: #86868b;
    margin-top: 0.15rem;
}

.card-chart {
    height: 160px;
    margin-bottom: 0.75rem;
}

.card-deals h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.deals-list {
    font-size: 0.85rem;
    line-height: 1.65;
    text-align: left;
}

.deals-list .deal-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0rem;
    border-bottom: 1px solid #f0f0f5;
    color: #1d1d1f;
    text-align: left;
}

.price-badge {
    flex-shrink: 0;
    /*width: 4.5rem;*/
    text-align: right;
    font-weight: 600;
    font-size: 0.8rem;
    background: #f5f5f7;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.deals-list .deal-item:last-child {
    border-bottom: none;
}

.deals-list .title-cell a {
    display: block;
    color: #0071e3;
    text-decoration: none;
    transition: color 0.15s;
}

.deals-list .title-cell a:hover {
    color: #004a99;
    text-decoration: underline;
}

.deals-list .deal-item.loading {
    color: #86868b;
}

.loading {
    text-align: center;
    color: #86868b;
}

.footer {
    text-align: center;
    padding: 1.5rem;
    color: #86868b;
    font-size: 0.85rem;
    border-top: 1px solid #e0e0e0;
    margin-top: 2rem;
}

@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: 1fr;
        padding: 0.75rem;
    }
}
