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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--page-bg);
    min-height: 100vh;
    padding: 20px;
    color: var(--page-text);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: var(--header-text);
    margin-bottom: 30px;
}

.header-top {
    display: grid;
    grid-template-columns: 1fr minmax(0, max-content) 1fr;
    align-items: start;
    gap: 12px 16px;
    margin-bottom: 20px;
}

.header-content {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    text-align: center;
    max-width: 36rem;
    width: max-content;
    min-width: 0;
}

.header-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.login-btn, .logout-btn, .save-btn {
    padding: 10px 20px;
    border: 2px solid var(--chrome-btn-border);
    background: var(--chrome-btn-bg);
    color: var(--chrome-btn-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.login-btn:hover, .logout-btn:hover, .save-btn:hover {
    background: var(--chrome-btn-bg-hover);
    border-color: var(--chrome-btn-border);
    transform: translateY(-2px);
}

.save-btn {
    background: rgba(40, 167, 69, 0.8);
    border-color: rgba(40, 167, 69, 1);
}

.save-btn:hover {
    background: rgba(40, 167, 69, 1);
}

.save-btn-locked {
    background: rgba(108, 117, 125, 0.8);
    border-color: rgba(108, 117, 125, 1);
    opacity: 0.9;
}

.save-btn-locked:hover {
    background: rgba(108, 117, 125, 1);
    opacity: 1;
    cursor: pointer;
}

.email-display {
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 5px;
}

.plus-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    background: var(--gradient-accent);
    color: var(--text-on-accent);
    border-radius: 12px;
    margin-right: 5px;
    box-shadow: 0 2px 4px rgba(var(--color-accent-rgb), 0.3);
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #333;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.tab-btn:hover {
    color: var(--color-accent);
}

.auth-form-container {
    margin-top: 20px;
}

.auth-form h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.1);
}

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    background: var(--color-accent);
    color: white;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-submit-btn:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--color-accent-rgb), 0.4);
}

.auth-error {
    margin-top: 10px;
    padding: 10px;
    background: #fee;
    color: #c33;
    border-radius: 6px;
    font-size: 0.9rem;
    display: none;
}

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

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: var(--header-title-shadow);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.header-usp {
    font-size: 0.95rem;
    opacity: 0.85;
    margin: 6px auto 0;
    max-width: 32rem;
    line-height: 1.4;
}

.header-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 24px;
    margin-top: 16px;
}

.currency-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.currency-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-btn-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    border: 2px solid var(--lang-btn-border);
    background: var(--lang-btn-bg);
    border-radius: 6px;
    cursor: pointer;
    line-height: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.lang-btn-flag:hover {
    background: var(--lang-btn-bg-hover);
    border-color: var(--lang-btn-border-hover);
    transform: translateY(-1px);
}

.lang-btn-flag.active {
    border-color: var(--lang-btn-active-border);
    background: var(--lang-btn-active-bg);
    box-shadow: 0 0 0 2px var(--lang-btn-active-ring);
}

.lang-flag-icon {
    display: block;
    width: 28px;
    height: 20px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.legal-lang-switch {
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.legal-lang-switch a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
}

.legal-lang-switch a:hover {
    text-decoration: underline;
}

.currency-toggle {
    margin-top: 0;
}

.currency-label {
    font-size: 1rem;
    font-weight: 500;
    margin-right: 5px;
}

.currency-btn {
    padding: 8px 20px;
    border: 2px solid var(--chrome-pill-border);
    background: var(--chrome-pill-bg);
    color: var(--header-text);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.currency-btn:hover {
    background: var(--chrome-pill-bg-hover);
    border-color: var(--chrome-btn-border);
}

.currency-btn.active {
    background: var(--chrome-pill-active-bg);
    color: var(--chrome-pill-active-color);
    border-color: var(--chrome-pill-active-border);
    font-weight: 600;
}

.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

/* Cancel tab: use full width (summary hidden) and center the panel */
.main-content.main-content--cancel-view {
    grid-template-columns: 1fr;
    justify-items: center;
}

.main-content.main-content--cancel-view #cancelOverviewView {
    width: 100%;
    max-width: 52rem;
}

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-top {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .header-content {
        grid-column: unset;
        grid-row: unset;
        width: 100%;
        max-width: none;
    }

    .header-actions {
        width: 100%;
        align-items: center;
    }

    .lang-toggle {
        justify-content: center;
    }

    .auth-section {
        width: 100%;
        justify-content: center;
    }
    
    .username-display {
        font-size: 0.8rem;
    }
    
    .login-btn, .logout-btn, .save-btn {
        font-size: 0.8rem;
        padding: 8px 16px;
    }
}

.subscriptions-section,
.summary-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.subscriptions-section h2,
.summary-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.add-subscription-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 2px dashed var(--color-accent);
}

.add-subscription-form h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr auto;
    gap: 10px;
    align-items: center;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

#newCustomCategory {
    grid-column: 1 / -1;
}

.form-row input,
.form-row select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.1);
}

.add-btn {
    padding: 12px 24px;
    border: none;
    background: var(--color-accent);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.add-btn:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--color-accent-rgb), 0.4);
}

.search-container {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.1);
}

.search-input::placeholder {
    color: #999;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--color-accent);
    background: white;
    color: var(--color-accent);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: var(--color-accent);
    color: white;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--color-accent);
    color: white;
}

.subscription-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.subscription-item {
    display: flex;
    align-items: center;
    padding: 18px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.subscription-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.subscription-item.selected {
    background: var(--selected-row-bg);
    border-color: var(--color-accent);
}

.subscription-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-right: 15px;
    cursor: pointer;
    accent-color: var(--color-accent);
}

.subscription-info {
    flex: 1;
}

.subscription-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 15px;
}

.subscription-name {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
    margin-bottom: 4px;
}

.subscription-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-container {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.category-display {
    font-size: 0.85rem;
    color: #666;
    text-transform: capitalize;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.category-display:hover {
    background-color: rgba(var(--color-accent-rgb), 0.1);
}

.category-input {
    font-size: 0.85rem;
    padding: 2px 6px;
    border: 2px solid var(--color-accent);
    border-radius: 4px;
    color: #333;
    text-transform: capitalize;
    font-family: inherit;
    min-width: 80px;
}

.category-input:focus {
    outline: none;
    border-color: var(--color-accent-hover);
    box-shadow: 0 0 0 2px rgba(var(--color-accent-rgb), 0.1);
}

.category-edit-icon {
    font-size: 0.6rem;
    opacity: 0.5;
    vertical-align: middle;
    cursor: pointer;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.category-container:hover .category-edit-icon {
    opacity: 0.8;
}

.plan-selector {
    font-size: 0.8rem;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #333;
    cursor: pointer;
    margin-top: 4px;
    max-width: 200px;
    font-family: inherit;
}

.plan-selector:hover {
    border-color: var(--color-accent);
}

.plan-selector:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(var(--color-accent-rgb), 0.2);
}

.plan-display {
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
    display: inline-block;
}

.subscription-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-accent);
    cursor: pointer;
    position: relative;
    min-width: 80px;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.price-display {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.price-display:hover {
    background-color: rgba(var(--color-accent-rgb), 0.1);
}

.edit-icon {
    font-size: 0.7rem;
    opacity: 0.5;
    vertical-align: middle;
    cursor: pointer;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.subscription-price:hover .edit-icon {
    opacity: 0.8;
}

.price-input {
    width: 90px;
    padding: 4px 8px;
    border: 2px solid var(--color-accent);
    border-radius: 4px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-accent);
    text-align: right;
    font-family: inherit;
}

.price-input:focus {
    outline: none;
    border-color: var(--color-accent-hover);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.1);
}

.bulk-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.action-btn {
    padding: 12px 24px;
    border: none;
    background: var(--color-accent);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--color-accent-rgb), 0.4);
}

.total-card {
    background: var(--summary-card-bg);
    color: var(--summary-card-text);
    border: var(--summary-card-border);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 25px;
}

.total-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.total-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.annual-label {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-top: 20px;
    margin-bottom: 8px;
}

.annual-amount {
    font-size: 1.8rem;
    font-weight: 600;
    opacity: 0.95;
}

.category-totals {
    margin-bottom: 25px;
}

.category-totals h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #555;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}

.category-name {
    font-weight: 500;
    color: #333;
    text-transform: capitalize;
}

.category-amount {
    font-weight: 600;
    color: var(--color-accent);
}

.selected-subscriptions-list {
    margin-bottom: 25px;
}

.selected-subscriptions-list h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #555;
}

#selectedSubscriptionsList {
    max-height: 200px;
    overflow-y: auto;
}

.selected-subscription-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.selected-subscription-name {
    color: #333;
    font-weight: 500;
}

.selected-subscription-price {
    font-weight: 600;
    color: var(--color-accent);
}

.stats {
    display: flex;
    gap: 15px;
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent);
}

.export-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #e9ecef;
}

.export-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #555;
}

.export-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.excel-btn {
    background: #28a745;
    color: white;
}

.excel-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.pdf-btn {
    background: #dc3545;
    color: white;
}

.pdf-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Upgrade Section Styles */
.upgrade-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #e9ecef;
}

.upgrade-content {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px dashed var(--color-accent);
}

.upgrade-content h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #555;
}

.upgrade-message {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.5;
}

.upgrade-trust {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 14px;
    line-height: 1.45;
}

.upgrade-trust a {
    color: var(--color-accent);
    font-weight: 600;
}

.upgrade-login-hint {
    font-size: 0.85rem;
    color: #888;
    margin-top: 12px;
    margin-bottom: 0;
}

.plus-plan-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.plus-plan-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: center;
}

.plus-plan-btn:hover:not(:disabled) {
    border-color: var(--color-accent);
    background: var(--highlight-bg);
}

.plus-plan-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.plus-plan-featured {
    border-color: var(--color-accent);
    background: var(--highlight-bg-strong);
}

.plus-plan-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.plus-plan-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    background: var(--color-accent);
    padding: 2px 10px;
    border-radius: 10px;
}

.plus-plan-sub {
    font-size: 0.8rem;
    color: #666;
}

.onboarding-plan-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.onboarding-plan-btns .onboarding-btn {
    width: 100%;
}

.onboarding-btn-offer {
    border: 2px solid var(--color-accent);
    background: var(--highlight-bg);
}

.upgrade-btn {
    padding: 12px 24px;
    border: none;
    background: var(--gradient-accent);
    color: var(--text-on-accent);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(var(--color-accent-rgb), 0.3);
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--color-accent-rgb), 0.4);
    background: var(--gradient-accent-hover);
}

/* Main navigation tabs (logged-in) */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.main-nav-btn {
    padding: 12px 22px;
    border: 2px solid var(--nav-btn-border);
    background: var(--nav-btn-bg);
    color: var(--nav-btn-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.main-nav-btn:hover {
    background: var(--nav-btn-bg-hover);
}

.main-nav-btn.active {
    background: var(--nav-btn-active-bg);
    color: var(--nav-btn-active-color);
    border-color: var(--nav-btn-active-border);
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #e74c3c;
    color: white;
    border-radius: 11px;
}

.section-hint {
    color: #666;
    font-size: 0.9rem;
    margin: -8px 0 16px 0;
    line-height: 1.45;
}

.subscription-item.marked-cancel {
    border-color: #e74c3c;
    background: #fff5f5;
}

.subscription-item.marked-cancel.cancel-done {
    border-color: #27ae60;
    background: #f0faf4;
}

.subscription-item.cancel-done .subscription-name {
    text-decoration: line-through;
    color: #888;
}

.nav-badge-done {
    background: #27ae60 !important;
}

.cancel-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 8px;
    user-select: none;
}

.cancel-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cancel-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    transition: background 0.2s ease;
}

.cancel-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cancel-toggle input:checked + .cancel-toggle-slider {
    background: #e74c3c;
}

.cancel-toggle input:checked + .cancel-toggle-slider::after {
    transform: translateX(20px);
}

.cancel-toggle-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.cancel-toggle input:checked ~ .cancel-toggle-label {
    color: #c0392b;
}

.cancel-overview-section > h2 {
    text-align: center;
}

.cancel-overview-section .legal-notice,
.cancel-overview-section > .section-hint {
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

.cancel-savings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
    max-width: 48rem;
    margin: 0 auto 24px;
}

.cancel-overview-section .cancel-list {
    width: 100%;
    max-width: 48rem;
    margin: 0 auto;
}

@media (max-width: 720px) {
    .cancel-savings-grid {
        grid-template-columns: 1fr;
    }
}

.cancel-overview-section .savings-card {
    color: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 0;
}

.cancel-overview-section .savings-card-potential {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.cancel-overview-section .savings-card-actual {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
}

.savings-card-title {
    margin: 0 0 4px;
    font-size: 1.1rem;
    font-weight: 700;
}

.savings-card-subtitle {
    margin: 0 0 16px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.savings-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.cancel-overview-section .savings-card .savings-row:last-of-type {
    margin-bottom: 16px;
}

.savings-label {
    font-size: 1rem;
    opacity: 0.95;
}

.savings-amount {
    font-size: 1.75rem;
    font-weight: 700;
}

.savings-amount.annual {
    font-size: 1.35rem;
    opacity: 0.95;
}

.savings-meta {
    font-size: 0.9rem;
    opacity: 0.9;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.cancel-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
}

.cancel-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #e74c3c;
}

.cancel-list-name {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

.cancel-list-meta {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
    text-transform: capitalize;
}

.cancel-list-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.cancel-list-price {
    font-weight: 600;
    color: #c0392b;
    white-space: nowrap;
}

.cancel-unmark-btn {
    padding: 6px 12px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #555;
    transition: all 0.2s ease;
}

.cancel-unmark-btn:hover {
    border-color: #e74c3c;
    color: #c0392b;
}

.cancel-empty {
    color: #999;
    text-align: center;
    padding: 40px 20px;
    line-height: 1.6;
}

.cancel-todo-section {
    margin-bottom: 24px;
}

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

.cancel-todo-heading {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cancel-todo-heading-done {
    color: #666;
}

.cancel-todo-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #e9ecef;
    color: #555;
    border-radius: 12px;
}

.cancel-todo-heading:not(.cancel-todo-heading-done) .cancel-todo-section-count {
    background: #fdecea;
    color: #c0392b;
}

.cancel-todo-heading-done .cancel-todo-section-count {
    background: #e8f8ef;
    color: #27ae60;
}

.cancel-todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cancel-todo-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    transition: background 0.2s ease;
}

.cancel-todo-item:hover {
    background: #f1f3f5;
}

.cancel-todo-item.cancel-todo-done {
    background: #fafafa;
    border-color: #e0e0e0;
}

.cancel-todo-check {
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.cancel-todo-check input {
    position: absolute;
    opacity: 0;
    width: 22px;
    height: 22px;
    cursor: pointer;
    margin: 0;
}

.cancel-todo-checkmark {
    display: block;
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 6px;
    background: white;
    transition: all 0.2s ease;
}

.cancel-todo-check input:checked + .cancel-todo-checkmark {
    background: #27ae60;
    border-color: #27ae60;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z'/%3E%3C/svg%3E");
    background-size: 16px;
    background-position: center;
    background-repeat: no-repeat;
}

.cancel-todo-body {
    flex: 1;
    min-width: 0;
}

.cancel-search-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-accent);
    text-decoration: none;
}

.cancel-search-link:hover {
    text-decoration: underline;
    color: var(--color-accent-hover);
}

.cancel-todo-done .cancel-search-link {
    color: #999;
}

.cancel-todo-done .cancel-list-name,
.cancel-todo-done .cancel-list-meta {
    text-decoration: line-through;
    color: #999;
}

.cancel-todo-done .cancel-list-price {
    color: #999;
    text-decoration: line-through;
}

.subscription-item.cancel-done .cancel-toggle input:checked + .cancel-toggle-slider {
    background: #27ae60;
}

.subscription-item.cancel-done .cancel-toggle input:checked ~ .cancel-toggle-label {
    color: #27ae60;
}

/* Onboarding */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
}

.onboarding-overlay[hidden] {
    display: none !important;
}

.onboarding-overlay.passthrough {
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.onboarding-overlay.passthrough .onboarding-modal {
    pointer-events: auto;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 480px;
    width: calc(100% - 40px);
    margin: 0;
}

.onboarding-modal {
    background: white;
    border-radius: 16px;
    padding: 28px 24px 20px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.onboarding-skip {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #888;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 8px;
}

.onboarding-skip:hover {
    color: #333;
}

.onboarding-progress {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.onboarding-modal h2 {
    font-size: 1.35rem;
    color: #222;
    margin-bottom: 10px;
}

.onboarding-modal p {
    color: #555;
    line-height: 1.55;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.onboarding-modal .onboarding-hint {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 16px;
}

.onboarding-modal .onboarding-hint a {
    color: var(--color-accent);
    font-weight: 600;
}

.onboarding-currency-btns {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}

.onboarding-currency-btns button {
    flex: 1;
    padding: 14px;
    border: 2px solid #ddd;
    border-radius: 12px;
    background: #f8f9fa;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.onboarding-currency-btns button.active,
.onboarding-currency-btns button:hover {
    border-color: var(--color-accent);
    background: var(--highlight-bg);
    color: var(--color-accent);
}

.onboarding-status {
    background: var(--highlight-bg);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.9rem;
    color: #445;
    margin: 12px 0;
}

.onboarding-status.complete {
    background: #e8f8ef;
    color: #1e6b3a;
}

.onboarding-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.onboarding-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.onboarding-btn-primary {
    background: var(--gradient-accent);
    color: var(--text-on-accent);
}

.onboarding-btn-primary:hover:not(:disabled) {
    opacity: 0.95;
    transform: translateY(-1px);
}

.onboarding-btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.onboarding-btn-secondary {
    background: #f0f0f0;
    color: #444;
}

.onboarding-btn-secondary:hover {
    background: #e4e4e4;
}

.onboarding-auth-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.onboarding-auth-btns .onboarding-btn {
    width: 100%;
}

.onboarding-btn-ghost {
    background: transparent;
    color: var(--color-accent);
    border: 1px dashed var(--color-accent);
}

.onboarding-btn-ghost:hover {
    background: var(--highlight-bg);
}

.onboarding-guest-note {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.45;
    margin-top: 12px;
    margin-bottom: 0;
    text-align: center;
}

body.onboarding-active .onboarding-highlight-target {
    position: relative;
    z-index: 2500;
    box-shadow: 0 0 0 3px var(--color-accent), 0 0 0 8px rgba(var(--color-accent-rgb), 0.35);
    border-radius: 12px;
}

.footer-link-btn {
    background: none;
    border: none;
    color: var(--footer-link);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    font-family: inherit;
}

.footer-link-btn:hover {
    color: var(--footer-link-hover);
}

/* Legal & trust */
.legal-notice {
    background: #fff8e6;
    border: 1px solid #f0d78c;
    border-left: 4px solid #e6a700;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #5c4a00;
}

.legal-notice strong {
    color: #3d3200;
}

.site-footer {
    text-align: center;
    margin-top: 28px;
    padding: 16px;
    font-size: 0.85rem;
}

.site-footer a {
    color: var(--footer-link);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
    color: var(--footer-link-hover);
}

.footer-sep {
    color: var(--footer-sep);
    margin: 0 8px;
}

.auth-privacy-note {
    font-size: 0.82rem;
    color: #2d6a4f;
    background: #edf7f1;
    border-radius: 8px;
    padding: 8px 10px;
    margin: 0 0 10px;
    line-height: 1.4;
}

.legal-consent {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.45;
    margin: 8px 0 12px;
}

.legal-consent a {
    color: var(--color-accent);
}

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    background: #1e1e2e;
    color: #eee;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner p {
    flex: 1;
    min-width: 200px;
    font-size: 0.85rem;
    line-height: 1.45;
    margin: 0;
}

.cookie-banner a {
    color: #a8b4ff;
}

.cookie-accept-btn {
    padding: 10px 20px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.cookie-accept-btn:hover {
    background: var(--color-accent-hover);
}

body.legal-page {
    background: var(--legal-page-bg);
    color: var(--page-text);
    min-height: 100vh;
}

.legal-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 48px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    margin-top: 24px;
    margin-bottom: 24px;
}

.legal-page .legal-back {
    margin-bottom: 20px;
}

.legal-page .legal-back a {
    color: var(--color-accent);
    text-decoration: none;
}

.legal-page h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: #222;
}

.legal-updated {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.legal-intro {
    margin-bottom: 24px;
    line-height: 1.6;
}

.legal-page h2 {
    font-size: 1.1rem;
    margin: 24px 0 10px;
    color: #333;
}

.legal-page p,
.legal-page li {
    line-height: 1.6;
    margin-bottom: 10px;
}

.legal-page ul {
    margin: 0 0 16px 20px;
}

.legal-page a {
    color: var(--color-accent);
}

.legal-footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
}

/* FAQ page */
.faq-page .faq-item {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e8e8e8;
}

.faq-page .faq-item:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-page .faq-item h2 {
    font-size: 1.05rem;
    margin: 0 0 10px;
    color: #333;
}

.faq-page .faq-item-featured {
    background: var(--highlight-bg);
    border-left: 4px solid var(--color-accent);
    padding: 16px 16px 16px 20px;
    border-radius: 0 8px 8px 0;
    border-bottom: none;
    margin-bottom: 32px;
}

/* Guide page */
.guide-page .guide-callout {
    background: var(--highlight-bg);
    border: 1px solid #c5d0f5;
    border-left: 4px solid var(--color-accent);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 20px 0;
    font-size: 0.92rem;
    line-height: 1.55;
}

.guide-page .guide-callout-plus {
    background: #f8f9fa;
    border-color: #dde2e8;
    border-left-color: var(--color-accent-secondary);
}

.guide-page .guide-steps {
    margin: 0 0 20px 1.25rem;
    padding: 0;
    line-height: 1.65;
}

.guide-page .guide-steps li {
    margin-bottom: 12px;
}

.guide-page .guide-steps-compact li {
    margin-bottom: 8px;
}

.guide-page .guide-cta {
    text-align: center;
    margin: 28px 0 16px;
}

.guide-page .guide-cta-btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--gradient-accent);
    color: var(--text-on-accent);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
}

.guide-page .guide-cta-btn:hover {
    opacity: 0.92;
}

.guide-page .guide-more {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

.guide-hint a {
    color: var(--color-accent);
    font-weight: 500;
    text-decoration: none;
}

.guide-hint a:hover {
    text-decoration: underline;
}

.faq-page .faq-more {
    margin-top: 8px;
    font-size: 0.95rem;
    color: #555;
}

/* Scrollbar styling */
.subscription-list::-webkit-scrollbar {
    width: 8px;
}

.subscription-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.subscription-list::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 10px;
}

.subscription-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-hover);
}

