/* Topic suggestions styles moved to css/components/topics.css */
/* File upload styles moved to css/components/file-upload.css */
/* Price chart styles moved to css/components/price-chart.css */

/* Mobile styles for modals */
@media (max-width: 768px) {
    /* On mobile, modal windows take full screen */
    .price-chart-modal,
    .calculator-modal {
        left: 0;
        right: 0;
        width: 100%;
    }
    
    .price-chart-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .price-chart-modal-title {
        font-size: 20px;
    }
    
    .price-chart-modal-chart {
        min-height: 400px;
    }
}

/* Financial Calculators Styles */
.calculator-modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    pointer-events: none;
    box-sizing: border-box;
}

.calculator-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
}

.calculator-modal#invoiceModal .calculator-modal-overlay {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 19999;
}

.calculator-modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    height: 90vh;
    background: var(--color-bg-modal);
    border-radius: var(--radius-xl);
    border: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: var(--z-modal);
    pointer-events: auto;
    box-sizing: border-box;
    min-height: 0;
}

.calculator-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xl) var(--spacing-2xl);
    border-bottom: none;
    flex-shrink: 0;
}

.calculator-modal#invoiceModal .calculator-modal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.calculator-title {
    font-family: var(--font-serif);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0 0 var(--spacing-md) 0;
}

.calculator-subtitle {
    font-size: var(--font-size-md);
    color: var(--color-text-tertiary);
    margin: 0;
}

.calculator-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.calculator-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.calculator-close .close-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1) opacity(0.9);
}

.calculator-content {
    padding: var(--spacing-2xl);
    padding-bottom: calc(var(--spacing-2xl) + 62px + var(--spacing-2xl));
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.calculator-content::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 28px;
    flex: 0 0 auto;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
}

.calculator-button-container {
    padding: var(--spacing-2xl);
    background: var(--color-bg-button-container);
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.calculator-input-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.calculator-input-group label {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.calculator-input-group input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) calc(var(--spacing-md) + 4px);
    background: var(--color-input-bg);
    border: var(--color-input-border);
    border-radius: var(--radius-xl);
    color: var(--color-input-text);
    font-size: var(--font-size-md);
    font-family: var(--font-primary);
    transition: all var(--transition-base);
    box-sizing: border-box;
}

.calculator-input-group input:focus {
    outline: none;
    background: var(--color-input-bg-focus);
    box-shadow: none;
}

.calculator-input-group input::placeholder {
    color: var(--color-input-placeholder);
}

.calculator-input-group input.error {
    border: 1px solid var(--color-text-primary);
    background: var(--color-input-bg-focus);
}

.calculator-error-message {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--color-border-error);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Button styles moved to css/components/buttons.css */

.calculator-result {
    margin-top: 24px;
    margin-bottom: 0;
    padding: 24px;
    background: #1A1A1A;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.calculator-result-placeholder .result-value {
    color: var(--color-text-muted);
    font-weight: var(--font-weight-normal);
}

/* Select for calculators */
.calculator-select {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-input-bg);
    border: 1px solid var(--color-border-secondary);
    border-radius: var(--radius-md);
    color: var(--color-input-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-normal);
    cursor: pointer;
    transition: all var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-lg) center;
    padding-right: 40px;
}

.calculator-select:hover {
    background-color: var(--color-input-bg-hover);
    border-color: var(--color-border-primary);
}

.calculator-select:focus {
    outline: none;
    border-color: var(--color-border-primary);
    background-color: var(--color-input-bg-focus);
}

/* Calculator results */
.calculator-result-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border-tertiary);
}

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

.calculator-result-label {
    color: var(--color-text-tertiary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calculator-result-value {
    color: var(--color-text-primary);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    margin-top: var(--spacing-xs);
}

.calculator-result-highlight {
    color: var(--color-success);
    font-size: var(--font-size-2xl);
}

.calculator-result-formula {
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    font-family: var(--font-mono);
    margin-top: var(--spacing-xs);
    white-space: pre-wrap;
}

.calculator-loading {
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    text-align: center;
    padding: var(--spacing-xl);
    font-style: italic;
}

.calculator-error {
    color: var(--color-error);
    font-size: var(--font-size-md);
    padding: var(--spacing-md);
    background: rgba(255, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-error);
}

/* Invoice Generator Styles */
.calculator-modal#invoiceModal {
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    z-index: 20000; /* Above chat and other elements */
}


.calculator-modal#invoiceModal .calculator-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    background: #121212;
    border-radius: 0; /* Remove border radius for fullscreen mode */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    z-index: 20001;
    pointer-events: auto;
}

/* Container with two columns */
.invoice-main-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* form | preview */
    gap: 20px;
    flex: 1;
    min-height: 0;
    overflow: visible;
    padding: 24px;
    align-items: stretch; /* Stretch columns to full height */
}

.calculator-modal#invoiceModal .invoice-main-container {
    flex: 1;
    min-height: 0;
    padding: 0 24px 24px 24px;
    align-items: stretch;
}

/* Left column - form */
.invoice-form-container {
    overflow-y: auto;
    overflow-x: visible; /* Allow dropdown to overflow horizontally */
    padding: 0;
    height: 100%;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    /* Hide system scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for WebKit browsers (Chrome, Safari) */
.invoice-form-container::-webkit-scrollbar,
.invoice-preview-container::-webkit-scrollbar {
    display: none;
}

/* Right column - preview */
.invoice-preview-container {
    display: flex;
    flex-direction: column;
    background: transparent;
    border-radius: 0;
    padding: 72px 0 0 0;
    overflow-y: auto;
    overflow-x: hidden;
    border: none;
    align-self: stretch;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    /* Hide system scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.invoice-preview-content {
    width: 624px;
    max-width: 624px;
    height: 800px;
    max-height: 800px;
    background: #ffffff;
    border-radius: 16px;
    overflow: auto;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    margin: 24px 0;
    box-sizing: border-box;
    flex-shrink: 0;
    /* Hide system scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for WebKit browsers (Chrome, Safari) */
.invoice-preview-content::-webkit-scrollbar {
    display: none;
}

.invoice-preview-content iframe {
    width: 624px;
    height: 800px;
    max-width: 624px;
    max-height: 800px;
    border: none;
    background: #ffffff;
    transform-origin: top left;
    display: block;
    border-radius: 0;
    flex-shrink: 0;
}

/* Styles for invoice preview according to Figma specification */
.invoice-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 32px;
    gap: 182px;
    position: relative;
    width: 624px;
    height: 800px;
    background: #FFFFFF;
    background: color(display-p3 1.000 1.000 1.000);
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Top - Upper section */
.invoice-preview .invoice-preview-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 40px;
    width: 560px;
    height: 404px;
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
}

/* Header - Header with logo */
.invoice-preview .invoice-preview-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0px;
    gap: 48px;
    width: 560px;
    min-width: 560px;
    max-width: 560px;
    height: 40px;
    flex: none;
    flex-shrink: 0;
    order: 0;
    align-self: flex-start;
    flex-grow: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* Invoice-1 - Header */
.invoice-preview .invoice-title {
    width: 256px;
    min-width: 256px;
    max-width: 256px;
    height: 40px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 700;
    font-size: 32px;
    line-height: 37px;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    flex-shrink: 0;
    order: 0;
    flex-grow: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Frame 10 - Logo container */
.invoice-preview .invoice-logo-frame {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    padding: 0px;
    gap: 10px;
    width: 256px;
    min-width: 256px;
    max-width: 256px;
    height: 40px;
    background: #F1F1F1;
    background: color(display-p3 0.945 0.945 0.945);
    border-radius: 8px;
    flex: none;
    flex-shrink: 0;
    order: 1;
    flex-grow: 0;
    overflow: hidden;
}

/* Remove background and border-radius when image exists */
.invoice-preview .invoice-logo-frame:has(img) {
    background: transparent;
    border-radius: 0;
}

.invoice-preview .invoice-logo {
    width: 256px;
    max-width: 256px;
    min-width: 0;
    height: 40px;
    max-height: 40px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    flex-shrink: 0;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.invoice-preview .invoice-logo img {
    max-width: 256px !important;
    max-height: 40px !important;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: right center;
    display: block;
    flex-shrink: 0;
}

/* Content - Content section */
.invoice-preview .invoice-preview-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 65px;
    width: 560px;
    height: 324px;
    flex: none;
    order: 1;
    align-self: stretch;
    flex-grow: 0;
}

/* Data - Date block */
.invoice-preview .invoice-data {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 6px;
    width: 172px;
    height: 34px;
    flex: none;
    order: 0;
    flex-grow: 0;
}

.invoice-preview .invoice-date-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0px;
    gap: 4px;
    width: 172px;
    height: 14px;
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
}

.invoice-preview .invoice-date-row.due-date {
    order: 1;
}

.invoice-preview .invoice-date-label {
    width: 80px;
    height: 14px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 700;
    font-size: 12px;
    line-height: 14px;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 0;
    flex-grow: 0;
}

.invoice-preview .invoice-date-value {
    width: 88px;
    height: 14px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 14px;
    text-align: right;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 1;
    flex-grow: 1;
}

/* Items - Products table */
.invoice-preview .invoice-items {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 16px;
    width: 560px;
    height: 70px;
    flex: none;
    order: 2;
    flex-grow: 0;
}

.invoice-preview .invoice-items-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0px;
    gap: 8px;
    width: 560px;
    height: 14px;
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
}

.invoice-preview .invoice-items-header .invoice-item-name {
    width: 254px;
    height: 14px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 14px;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 0;
    flex-grow: 0;
}

.invoice-preview .invoice-items-header .invoice-item-qty {
    width: 94px;
    height: 14px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 14px;
    text-align: right;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 1;
    flex-grow: 1;
}

.invoice-preview .invoice-items-header .invoice-item-rate {
    width: 94px;
    height: 14px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 14px;
    text-align: right;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 2;
    flex-grow: 1;
}

.invoice-preview .invoice-items-header .invoice-item-price {
    width: 94px;
    height: 14px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 14px;
    text-align: right;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 3;
    flex-grow: 1;
}

.invoice-preview .invoice-items-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 12px;
    width: 560px;
    height: 40px;
    flex: none;
    order: 1;
    align-self: stretch;
    flex-grow: 0;
}

.invoice-preview .invoice-item-row-preview {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0px;
    gap: 8px;
    width: 560px;
    height: 14px;
    flex: none;
    align-self: stretch;
    flex-grow: 0;
}

.invoice-preview .invoice-item-row-preview:first-child {
    order: 0;
}

.invoice-preview .invoice-item-row-preview:last-child {
    order: 1;
}

.invoice-preview .invoice-item-name {
    width: 254px;
    height: 14px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 14px;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 0;
    flex-grow: 0;
}

.invoice-preview .invoice-item-qty {
    width: 94px;
    height: 14px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 14px;
    text-align: right;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 1;
    flex-grow: 1;
}

.invoice-preview .invoice-item-rate {
    width: 94px;
    height: 14px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 14px;
    text-align: right;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 2;
    flex-grow: 1;
}

.invoice-preview .invoice-item-price {
    width: 94px;
    height: 14px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 14px;
    text-align: right;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 3;
    flex-grow: 1;
}

/* Down - Lower section */
.invoice-preview .invoice-preview-down {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 36px;
    width: 560px;
    height: 150px;
    flex: none;
    order: 1;
    align-self: stretch;
    flex-grow: 0;
}

/* Total - Total amount */
.invoice-preview .invoice-total {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    gap: 12px;
    width: 560px;
    height: 66px;
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
}

/* Frame 11 - Authorized Signature container */
.invoice-preview .invoice-signature-frame {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 0px;
    gap: 10px;
    width: 88px;
    height: 48px;
    border: none;
    flex: none;
    order: 1;
    flex-grow: 0;
}

.invoice-preview .invoice-signature {
    width: 88px;
    height: 48px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 14px;
    display: flex;
    align-items: center;
    text-align: center;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 1;
}

.invoice-preview .invoice-total-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0px;
    gap: 8px;
    width: 560px;
    height: 14px;
    flex: none;
    align-self: stretch;
    flex-grow: 0;
}

.invoice-preview .invoice-total-row.subtotal {
    order: 0;
}

.invoice-preview .invoice-total-row.tax {
    order: 1;
}

.invoice-preview .invoice-total-row.total {
    order: 2;
    height: 14px;
}

.invoice-preview .invoice-total-label {
    width: 254px;
    height: 14px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 14px;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 0;
    flex-grow: 0;
}

.invoice-preview .invoice-total-row.total .invoice-total-label {
    height: 14px;
    font-weight: 700;
    font-size: 12px;
    line-height: 14px;
}

.invoice-preview .invoice-total-value {
    width: 298px;
    height: 14px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 14px;
    text-align: right;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 1;
    flex-grow: 1;
}

.invoice-preview .invoice-total-row.total .invoice-total-value {
    height: 14px;
    font-weight: 700;
    font-size: 12px;
    line-height: 14px;
}

/* Address - From/To addresses */
.invoice-preview .invoice-address {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0px;
    gap: 48px;
    width: 560px;
    height: 90px;
    flex: none;
    order: 1;
    flex-grow: 0;
}

.invoice-preview .invoice-address-from {
    width: 256px;
    height: 90px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 18px;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 0;
    flex-grow: 1;
}

.invoice-preview .invoice-address-to {
    width: 256px;
    height: 90px;
    font-family: 'Arial';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 18px;
    color: #000000;
    color: color(display-p3 0.000 0.000 0.000);
    flex: none;
    order: 1;
    flex-grow: 1;
}

.invoice-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 24px;
}

.invoice-form-section {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border-bottom: none;
    padding-bottom: 0;
    display: block;
    min-height: 48px; /* prevent section collapse */
}

.invoice-theme-picker--form {
    display: block;
    min-height: 48px; /* ensure palette visibility */
    padding: 4px 8px;
}

/* Theme color picker (desktop/global) */
.invoice-theme-picker .theme-swatches,
.invoice-theme-picker--form .theme-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    min-height: 44px;
}

.invoice-theme-picker--form .theme-swatch,
.invoice-theme-picker .theme-swatch {
    display: inline-block;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.6);
    background: var(--swatch, #1A73E8);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.25) inset;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.2s ease;
}

.invoice-theme-picker .theme-swatch[aria-pressed="true"],
.invoice-theme-picker--form .theme-swatch[aria-pressed="true"] {
    transform: scale(1.05);
    border-color: #ffffff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.25) inset, 0 0 0 2px rgba(255,255,255,0.8);
}

/* Light theme: Selected color swatch - use primary color for border */
body.light-theme .invoice-theme-picker .theme-swatch[aria-pressed="true"],
body.light-theme .invoice-theme-picker--form .theme-swatch[aria-pressed="true"] {
    border-color: var(--color-button-primary);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1) inset, 0 0 0 2px var(--color-button-primary);
}

.invoice-section-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-top: 24px;
    margin-bottom: 16px;
    text-transform: none;
}

.invoice-form-section-title-first {
    margin-top: 0 !important;
}

.invoice-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.invoice-form-row:last-child {
    margin-bottom: 0;
}

.invoice-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 24px;
}

.invoice-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
}

/* Base input styles moved to css/components/inputs.css */
.invoice-form-group input.error,
.invoice-item-row input.error {
    border: 1px solid #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.invoice-error-message {
    margin-top: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.invoice-form-group {
    position: relative;
}

/* Component styles moved to separate files:
 * - css/components/selects.css
 * - css/components/inputs.css
 * - css/components/buttons.css
 * - css/components/calendar.css
 */


/* Gap for blocks in Additional Information section (Notes, Terms, Signature) */
.invoice-form-section-additional .invoice-form-group:not(:first-child) {
    margin-top: 20px;
}

/* Invoice generate button styles moved to css/components/buttons.css */

.invoice-file-upload {
    position: relative;
}

.invoice-file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.invoice-file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: auto;
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.invoice-file-label:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.invoice-preview-image {
    max-width: 200px;
    max-height: 80px;
    border-radius: 8px;
    margin-top: 10px;
}

/* Styles for displaying uploaded file */
.invoice-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
}

.invoice-file-thumbnail {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

.invoice-file-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-remove-file-btn {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.invoice-remove-file-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    color: #ff6666;
    transform: scale(1.05);
}

.invoice-items-header-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 0;
    border-radius: 8px;
}

.invoice-items-header-row .invoice-form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.invoice-items-header-row .invoice-form-group label {
    margin-bottom: 0;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    display: block;
}

.invoice-items-header-row .invoice-item-description {
    grid-column: 1;
}

.invoice-items-header-row .invoice-item-quantity {
    grid-column: 2;
}

.invoice-items-header-row .invoice-item-price {
    grid-column: 3;
}

.invoice-items-header-row .invoice-item-actions {
    grid-column: 4;
}

.invoice-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    align-items: start;
    margin-bottom: 10px;
    padding: 8px 0;
    border-radius: 8px;
}

.invoice-item-description {
    grid-column: 1;
}

.invoice-item-quantity {
    grid-column: 2;
}

.invoice-item-price {
    grid-column: 3;
}

.invoice-item-actions {
    grid-column: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
}

.invoice-remove-item-btn {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.invoice-remove-item-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    color: #ff6666;
    transform: scale(1.05);
}

.invoice-add-item-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 6px;
}

.invoice-add-item-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.invoice-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 0 0 24px 0;
    padding: 0;
    border-top: none;
    width: 624px;
    max-width: 624px;
    align-self: center;
    flex-shrink: 0;
}

/* Invoice button styles moved to css/components/buttons.css */

@media (max-width: 768px) {
    /* Responsive styles for invoice modal (mobile) */
    .calculator-modal#invoiceModal {
        width: 100%;
        padding: 0;
    }
    
    .calculator-modal#invoiceModal .calculator-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .calculator-modal#invoiceModal .calculator-modal-header {
        padding: 16px;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .calculator-modal#invoiceModal .calculator-title {
        font-size: 18px;
        margin: 0 0 8px 0;
    }
    
    .calculator-modal#invoiceModal .calculator-subtitle {
        font-size: 12px;
    }
    
    .calculator-modal#invoiceModal .calculator-close {
        width: 32px;
        height: 32px;
    }
    
    .calculator-modal#invoiceModal .calculator-close .close-icon {
        width: 14px;
        height: 14px;
    }
    
    .calculator-modal#invoiceModal .invoice-main-container {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        gap: 16px;
        flex: 1;
        min-height: 0;
        padding: 0 16px 16px 16px;
        overflow-y: auto;
        overflow-x: visible; /* Allow horizontal overflow for scaled preview */
    }
    
    /* Form container - at top, takes full screen */
    .invoice-form-container {
        order: -1 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        padding: 0;
        height: auto;
        flex: 0 0 auto;
        align-self: stretch !important;
        grid-column: 1 / -1 !important; /* In case grid is still active */
    }
    
    /* Preview container - at end of page on mobile */
.invoice-preview-container {
        order: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center;
        justify-content: flex-start;
        max-height: none !important;
        min-height: auto;
        height: auto !important;
        padding: 0 !important;
        padding-top: 0 !important;
        background: transparent !important;
        border: none !important;
        margin-top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-y: visible;
        overflow-x: hidden;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 0 0 auto;
        align-self: stretch !important;
        grid-column: 1 / -1 !important; /* In case grid is still active */
    }
    
    /* Responsive preview content - full screen width with visual scaling */
    .invoice-preview-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 400px !important; /* Fixed height = 800px * 0.5 (scale) */
        max-height: 400px !important;
        min-height: 400px !important;
        padding: 0 !important;
        margin: 0 0 0 0 !important; /* Remove bottom margin to avoid empty space */
        border-radius: 8px !important;
        flex-shrink: 0;
        background: transparent !important;
        overflow: hidden !important; /* Hide parts overflowing during scaling */
        position: relative;
        z-index: 1;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Responsive iframe - visually scaled down to view entire PDF */
    .invoice-preview-content iframe {
        width: 624px !important; /* Original width */
        max-width: 624px !important;
        height: 800px !important; /* Original height */
        min-height: 800px !important;
        max-height: 800px !important;
        border-radius: 8px;
        display: block !important;
        background: #ffffff !important;
        border: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: scale(0.5); /* Visually scale down by 50% */
        transform-origin: top center;
        margin-left: 0 !important;
        margin-right: 0 !important;
        flex-shrink: 0;
    }
    
    /* Styles for preview inside iframe are not applied via main CSS (iframe is isolated) */
    /* Responsive styles for preview should be in HTML loaded into iframe */
    
    
    /* Responsive styles for form */
    .invoice-form {
        margin-top: 0;
        gap: 16px;
    }
    
    .invoice-form-section-title {
        font-size: 14px;
        margin-top: 20px;
        margin-bottom: 12px;
    }
    
    .invoice-form-section-title-first {
        margin-top: 0 !important;
    }
    
    .invoice-form-row {
        grid-template-columns: 1fr !important;
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .invoice-form-group {
        margin-bottom: 16px;
    }
    
    .invoice-form-group label {
        font-size: 12px;
    }
    
    /* Responsive styles for product items */
    .invoice-items-header-row {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
    
    .invoice-items-header-row .invoice-item-description,
    .invoice-items-header-row .invoice-item-quantity,
    .invoice-items-header-row .invoice-item-price,
    .invoice-items-header-row .invoice-item-actions {
        grid-column: 1 !important;
    }
    
    .invoice-item-row {
        display: grid !important;
        grid-template-columns: 1fr auto !important; /* Description/quantity/price on left, button on right */
        gap: 12px;
        align-items: start;
        position: relative;
    }
    
    .invoice-item-description,
    .invoice-item-quantity,
    .invoice-item-price {
        grid-column: 1 !important;
    }
    
    .invoice-item-actions {
        grid-column: 2 !important;
        grid-row: 1 !important; /* Button in first row */
        justify-content: center !important;
        align-items: flex-start !important;
        margin-top: 0;
        padding-top: 0;
        align-self: start; /* Align to top edge */
    }
    
    /* Responsive styles for action buttons */
    .invoice-preview-container .invoice-actions {
        width: 100% !important;
        max-width: 100% !important;
        flex-direction: row !important; /* Buttons horizontally */
        gap: 12px !important; /* Space between buttons */
        margin: 24px 0 24px 0 !important; /* Top margin between preview and buttons */
        padding: 0 !important;
        align-self: stretch !important;
        display: flex !important;
        transform: none !important; /* Buttons should not scale */
        order: 2 !important; /* Buttons after preview */
        position: relative;
        z-index: 10; /* Buttons above everything */
    }
    
    .invoice-preview-container .invoice-btn {
        width: auto !important;
        flex: 1 1 0 !important; /* Buttons evenly distributed across width */
        height: 44px !important; /* Fixed button height */
        min-height: 44px !important;
        max-height: 44px !important;
        padding: 0 24px !important;
        transform: none !important; /* Buttons should not scale */
        position: relative;
        z-index: 10;
        box-sizing: border-box !important;
    }
    
    /* Responsive styles for theme */
    .invoice-theme-picker--form .theme-swatches {
        gap: 8px;
    }
    
    .invoice-theme-picker--form .theme-swatch {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
    }
}

/* Styles for iPad (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Responsive styles for invoice modal on iPad */
    .calculator-modal#invoiceModal .invoice-main-container {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        gap: 16px;
        flex: 1;
        min-height: 0;
        padding: 0 16px 16px 16px;
        overflow-y: auto;
        overflow-x: visible;
    }
    
    /* Form container - at top, takes full screen */
    .invoice-form-container {
        order: -1 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        padding: 0;
        height: auto;
        flex: 0 0 auto;
        align-self: stretch !important;
        grid-column: 1 / -1 !important;
    }
    
    /* Preview container - at end of page on iPad */
    .invoice-preview-container {
        order: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center;
        justify-content: flex-start;
        max-height: none !important;
        min-height: auto;
        height: auto !important;
        padding: 0 !important;
        padding-top: 0 !important;
        background: transparent !important;
        border: none !important;
        margin-top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-y: visible;
        overflow-x: hidden;
        visibility: visible !important;
        opacity: 1 !important;
        flex: 0 0 auto;
        align-self: stretch !important;
        grid-column: 1 / -1 !important;
    }
    
    /* Responsive preview content for iPad - same as desktop */
    .invoice-preview-content {
        width: 624px !important;
        max-width: 624px !important;
        height: 800px !important;
        max-height: 800px !important;
        min-height: 800px !important;
        padding: 0 !important;
        margin: 0 auto 0 auto !important; /* Center preview */
        border-radius: 16px !important;
        flex-shrink: 0;
        background: #ffffff !important;
        overflow: auto !important;
        position: relative;
        z-index: 1;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        box-sizing: border-box !important;
    }
    
    /* Responsive iframe for iPad - without scaling, same as desktop */
    .invoice-preview-content iframe {
        width: 624px !important;
        max-width: 624px !important;
        height: 800px !important;
        min-height: 800px !important;
        max-height: 800px !important;
        border-radius: 0 !important;
        display: block !important;
        background: #ffffff !important;
        border: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important; /* No scaling */
        transform-origin: top left !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        flex-shrink: 0;
    }
    
    /* Responsive styles for action buttons on iPad */
    .invoice-preview-container .invoice-actions {
        width: 100% !important;
        max-width: 100% !important;
        flex-direction: row !important; /* Buttons horizontally */
        gap: 12px !important;
        margin: 24px 0 24px 0 !important;
        padding: 0 !important;
        align-self: stretch !important;
        display: flex !important;
        transform: none !important;
        order: 2 !important;
        position: relative;
        z-index: 10;
    }
    
    .invoice-preview-container .invoice-btn {
        width: auto !important;
        flex: 1 1 0 !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        padding: 0 24px !important;
        transform: none !important;
        position: relative;
        z-index: 10;
        box-sizing: border-box !important;
    }
    
    /* Responsive styles for file upload */
    .invoice-file-label {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .invoice-file-info {
        padding: 6px 10px;
        gap: 8px;
    }
    
    .invoice-file-thumbnail {
        width: 28px;
        height: 28px;
    }
    
    .invoice-file-name {
        font-size: 12px;
    }
    
    .invoice-remove-file-btn {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
    
    /* Responsive styles for currency and language selects */
    .invoice-currency-wrapper {
        width: 100%;
    }
    
    .invoice-currency-select {
        width: 100%;
    }
    
    /* Responsive styles for dates */
    .invoice-date-wrapper {
        width: 100%;
    }
    
    /* Responsive styles for add item button */
    .invoice-add-item-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Responsive styles for remove item button */
    .invoice-remove-item-btn {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 16px;
    min-width: 0;
}

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

.result-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-value {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 60%;
}

.result-value.positive {
    color: #4caf50;
}

.result-value.negative {
    color: #f44336;
}

.result-value.highlight {
    font-size: 20px;
    color: #ffffff;
}

.calculator-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
    justify-content: flex-start;
}

/* Calculator button styles moved to css/components/buttons.css */

.calculator-buttons-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 16px; /* Margin between categories */
}

.calculator-buttons-container:last-child {
    margin-bottom: 0; /* Remove margin from last category */
}

/* Topic suggestions styles moved to css/components/topics.css */

/* === Invoice Preview Overrides (fix white corners/bg) === */
.invoice-preview-container {
    background: transparent !important;
}
.invoice-preview-content {
    background: transparent !important;
    border-radius: 36px !important;
    overflow: hidden !important;
}

/* Remove bottom padding in invoice main container to avoid visual cut-off */
.calculator-modal#invoiceModal .invoice-main-container {
    padding-bottom: 0 !important;
}

@media (max-width: 768px) {
    .calculator-modal-content {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .calculator-title {
        font-size: 20px;
        margin: 0 0 12px 0; /* Keep margin on mobile */
    }
    
    .calculator-content {
        padding: 20px;
    }
}

/* ============================================
   CENTER CONTENT BLOCK - TOOLS & CALCULATORS
   (Стиль карточек на основе CodePen примера)
   ============================================ */

:root {
    --background-color: #0A0A0A;
    --text-color: #A1A1AA;
    --card-background-color: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 50%, rgba(255, 255, 255, 0.03) 100%);
    --card-border-color: rgba(255, 255, 255, 0.1);
    --card-box-shadow-1: rgba(0, 0, 0, 0.05);
    --card-box-shadow-1-y: 3px;
    --card-box-shadow-1-blur: 6px;
    --card-box-shadow-2: rgba(0, 0, 0, 0.1);
    --card-box-shadow-2-y: 8px;
    --card-box-shadow-2-blur: 15px;
    --card-label-color: #FFFFFF;
    --card-icon-color: #D4D4D8;
    --card-icon-background-color: rgba(255, 255, 255, 0.08);
    --card-icon-border-color: rgba(255, 255, 255, 0.12);
    --card-shine-opacity: .1;
    --card-shine-gradient: conic-gradient(from 205deg at 50% 50%, rgba(16, 185, 129, 0) 0deg, #10B981 25deg, rgba(52, 211, 153, 0.18) 295deg, rgba(16, 185, 129, 0) 360deg);
    --card-line-color: #2A2B2C;
    --card-tile-color: rgba(16, 185, 129, 0.05);
    --card-hover-border-color: rgba(255, 255, 255, 0.2);
    --card-hover-box-shadow-1: rgba(0, 0, 0, 0.04);
    --card-hover-box-shadow-1-y: 5px;
    --card-hover-box-shadow-1-blur: 10px;
    --card-hover-box-shadow-2: rgba(0, 0, 0, 0.3);
    --card-hover-box-shadow-2-y: 15px;
    --card-hover-box-shadow-2-blur: 25px;
    --card-hover-icon-color: #34D399;
    --card-hover-icon-background-color: rgba(52, 211, 153, 0.1);
    --card-hover-icon-border-color: rgba(52, 211, 153, 0.2);
}

.center-content {
    flex: 1;
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    background: none;
    height: 100%;
    z-index: 1;
}

.content-block {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    padding: 0 var(--spacing-6xl) var(--spacing-5xl) var(--spacing-6xl);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xl);
    background: transparent;
    border-radius: 0;
    margin: 0;
    align-self: stretch;
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.content-block::-webkit-scrollbar {
    display: none;
}

/* Light theme overrides */
body.light-theme {
    background: var(--color-bg-primary); /* Uses light theme variable */
    color: var(--color-text-primary); /* Uses light theme variable */
    color-scheme: light;
}

body.light-theme .left-nav {
    background: rgb(255, 255, 255); /* One tone lighter than body */
    box-shadow: none;
}

body.light-theme .nav-logo-text {
    color: #020617;
    -webkit-text-fill-color: #020617;
}

body.light-theme .nav-logo-short {
    color: #020617;
    -webkit-text-fill-color: #020617;
}

body.light-theme .nav-overflow-logo {
    color: #020617;
    -webkit-text-fill-color: #020617;
}

/* SVG logo in light theme - black */
body.light-theme .nav-logo-svg {
    filter: brightness(0);
}

body.light-theme .nav-logo-svg svg {
    color: #000000;
    fill: #000000;
}

body.light-theme .nav-logo-svg-icon {
    filter: brightness(0);
}

body.light-theme .nav-logo-svg-icon svg {
    color: #000000;
    fill: #000000;
}

body.light-theme .nav-logo-svg-icon svg path {
    fill: #000000 !important;
}

body.light-theme .nav-items .nav-text {
    color: rgba(15, 23, 42, 0.7);
}

body.light-theme .nav-item.active .nav-text {
    color: #0f172a;
}

/* Light theme: icons in menu are black (via filter) */
body.light-theme .nav-icon {
    /* convert white/colored svg to black */
    filter: brightness(0) invert(0);
    opacity: 0.7;
}

body.light-theme .nav-item.active .nav-icon {
    filter: brightness(0) invert(0);
    opacity: 1;
}

body.light-theme .nav-item-disabled .nav-icon {
    filter: brightness(0) invert(0);
    opacity: 0.3;
}

/* Light theme: menu hover colors (icon + text) */
body.light-theme .nav-item:hover:not(.nav-item-disabled):not(.active) {
    background: rgba(15, 23, 42, 0.06); /* light gray background */
}

body.light-theme .nav-item:hover:not(.nav-item-disabled):not(.active) .nav-text {
    color: #0f172a; /* almost black like active */
}

body.light-theme .nav-item:hover:not(.nav-item-disabled):not(.active) .nav-icon {
    filter: brightness(0) invert(0);
    opacity: 0.9;
}

/* Light theme styles for Settings */
body.light-theme .nav-item-settings:hover:not(.nav-item-active) {
    background: rgba(15, 23, 42, 0.06);
}

body.light-theme .nav-item-settings:hover:not(.nav-item-active) .nav-text {
    color: #0f172a;
}

body.light-theme .nav-item-settings:hover:not(.nav-item-active) .nav-icon {
    filter: brightness(0) invert(0);
    opacity: 0.9;
}

body.light-theme .nav-item-settings.nav-item-active {
    background: rgba(15, 23, 42, 0.1);
}

body.light-theme .content-block {
    background: transparent;
}

body.light-theme .content-main-title {
    background: linear-gradient(135deg, #020617 0%, #0f172a 60%, #111827 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .tool-card::before {
    /* Light cards - one tone lighter than body */
    background: rgb(255, 255, 255);
    box-shadow: none;
}

/* User block colors in light theme */
body.light-theme .nav-user {
    border-color: rgba(148, 163, 184, 0.2);
    background: transparent; /* no separate background, only border */
}

body.light-theme .nav-user-name {
    color: #111827; /* almost black */
}

body.light-theme .nav-user-role {
    color: rgba(55, 65, 81, 0.7); /* gray subtitle */
}

body.light-theme .tool-card h4 {
    color: #111827; /* almost black */
}

body.light-theme .tool-card p {
    color: rgba(55, 65, 81, 0.9); /* dark gray text */
}

/* In light theme, cards should not have shadows, even on hover */
body.light-theme .tool-card {
    box-shadow: none;
    background-color: transparent; /* remove dark background from base card so edges don't show */
}

/* In light theme on hover, card becomes green (#10B981), icon and text white */
body.light-theme .tool-card:hover {
    box-shadow: none;
}

body.light-theme .tool-card:hover::before {
    background: #10B981;
}

/* h4 becomes white on hover in light theme */
body.light-theme .tool-card:hover h4 {
    color: #ffffff;
}

body.light-theme .tool-card:hover p {
    color: #ffffff;
}

/* Light theme для мобильного меню - дополнительные стили */
body.light-theme .nav-overflow-label {
    color: rgba(15, 23, 42, 0.7);
}

body.light-theme .nav-overflow-link:hover .nav-overflow-label {
    color: #0f172a;
}

body.light-theme .nav-overflow-icon {
    filter: brightness(0) opacity(0.7);
}

body.light-theme .nav-overflow-link:hover .nav-overflow-icon {
    filter: brightness(0) opacity(1);
}

body.light-theme .nav-overflow-link-disabled:hover {
    background: rgba(15, 23, 42, 0.05) !important;
}

body.light-theme .nav-overflow-toggle:hover {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.2);
}

body.light-theme .nav-overflow-toggle-icon {
    filter: brightness(0) opacity(0.7);
}

/* Light theme для nav-overflow-list и других элементов внутри меню */
body.light-theme .nav-overflow-list {
    /* Список уже наследует стили от родителя */
}

/* Light theme для элементов внутри nav-overflow-menu на мобильных */
@media (min-width: 320px) and (max-width: 800px) {
    body.light-theme .nav-overflow-list {
        /* Стили для списка в мобильном меню */
    }
    
    body.light-theme .nav-overflow-link {
        background: rgba(15, 23, 42, 0.05) !important;
        color: rgba(15, 23, 42, 0.7) !important;
    }
    
    body.light-theme .nav-overflow-link:hover {
        background: rgba(15, 23, 42, 0.1) !important;
        color: #0f172a !important;
    }
    
    body.light-theme .nav-overflow-label {
        color: rgba(15, 23, 42, 0.7) !important;
    }
    
    body.light-theme .nav-overflow-link:hover .nav-overflow-label {
        color: #0f172a !important;
    }
    
    body.light-theme .nav-overflow-icon {
        filter: brightness(0) opacity(0.7) !important;
    }
    
    body.light-theme .nav-overflow-link:hover .nav-overflow-icon {
        filter: brightness(0) opacity(1) !important;
    }
}

/* Icons become white on hover in light theme */
body.light-theme .tool-card:hover .icon svg {
    color: #ffffff;
    opacity: 1; /* Full opacity on hover */
}

/* Icon circle background becomes transparent/white on hover */
body.light-theme .tool-card:hover .icon::after {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Shine effect white on hover in light theme */
body.light-theme .tool-card:hover .shine {
    opacity: 1;
    transition-duration: .5s;
    transition-delay: 0s;
}

body.light-theme .tool-card:hover .shine:before {
    background-image: conic-gradient(from 205deg at 50% 50%, rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, 0.3) 25deg, rgba(255, 255, 255, 0.1) 295deg, rgba(255, 255, 255, 0) 360deg);
}

/* Tiles animation white on hover in light theme */
body.light-theme .tool-card:hover .background .tiles {
    opacity: 1;
    transition-delay: .25s;
}

body.light-theme .tool-card:hover .background .tiles .tile {
    animation-name: tile;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Line animation white on hover in light theme */
body.light-theme .tool-card:hover .background .line {
    opacity: 1;
    transition-duration: .15s;
}

body.light-theme .tool-card:hover .background .line:before {
    transform: scaleX(1);
    background-color: rgba(255, 255, 255, 0.3);
}

body.light-theme .tool-card:hover .background .line:after {
    transform: scaleY(1);
    background-color: rgba(255, 255, 255, 0.3);
}

body.light-theme .tool-card:hover .background .line.line-1:before,
body.light-theme .tool-card:hover .background .line.line-1:after {
    transition-delay: .0s;
}

body.light-theme .tool-card:hover .background .line.line-2:before,
body.light-theme .tool-card:hover .background .line.line-2:after {
    transition-delay: .15s;
}

body.light-theme .tool-card:hover .background .line.line-3:before,
body.light-theme .tool-card:hover .background .line.line-3:after {
    transition-delay: .3s;
}

/* Light theme: icon circle border dark gray */
body.light-theme {
    --card-icon-border-color: rgba(15, 23, 42, 0.35);
    --card-shine-gradient: conic-gradient(from 205deg at 50% 50%, rgba(128, 128, 128, 0) 0deg, rgba(128, 128, 128, 0.15) 25deg, rgba(128, 128, 128, 0.05) 295deg, rgba(128, 128, 128, 0) 360deg); /* Gray shine effect */
    --card-tile-color: rgba(128, 128, 128, 0.08); /* Gray tiles */
    --card-line-color: rgba(128, 128, 128, 0.2); /* Gray lines */
}

/* Icons in cards for light theme - dark with slight transparency */
body.light-theme .tool-card .icon svg {
    color: #020617;
    opacity: 0.7;
}

body.light-theme .chat-panel {
    background: rgb(255, 255, 255); /* One tone lighter than body */
}

body.light-theme .chat-messages {
    background-color: rgba(15, 23, 42, 0.02);
}

body.light-theme .chat-input-wrapper {
    background: rgb(240, 240, 240); /* Darker than chat background for contrast */
    border: 1px solid transparent; /* Transparent border for smooth appearance */
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

body.light-theme .chat-input-wrapper:focus-within {
    background: rgb(232, 232, 232); /* Darker on focus */
    border-color: rgba(0, 0, 0, 0.1); /* Border appears smoothly on focus */
}

/* Light theme: Modals - all texts should be black like in index.html, inputs like in chat */
body.light-theme .calculator-modal-content {
    background: rgb(248, 248, 248); /* Light gray background, lighter than inputs */
}

body.light-theme .calculator-title {
    color: #000000;
}

body.light-theme .calculator-subtitle {
    color: rgba(0, 0, 0, 0.6);
}

body.light-theme .calculator-input-group label {
    color: rgba(0, 0, 0, 0.8);
}

/* Calculator inputs - same as chat input in light theme */
body.light-theme .calculator-input-group input {
    background: rgb(240, 240, 240);
    border: 1px solid transparent;
    color: #000000;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

body.light-theme .calculator-input-group input:focus {
    background: rgb(232, 232, 232);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .calculator-input-group input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

body.light-theme .calculator-input-group input.error {
    border: 1px solid rgba(255, 68, 68, 0.5);
    background: rgba(255, 68, 68, 0.05);
}

body.light-theme .calculator-error-message {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #dc2626;
}

/* Calculator select - same styling as inputs */
body.light-theme .calculator-select {
    background: rgb(240, 240, 240);
    border: 1px solid transparent;
    color: #000000;
}

body.light-theme .calculator-select:hover {
    background: rgb(232, 232, 232);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .calculator-select:focus {
    background: rgb(232, 232, 232);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Calculator results in light theme - darker background to stand out from modal */
body.light-theme .calculator-result {
    background: rgb(240, 240, 240); /* Same as inputs - darker than modal background */
    border: 1px solid rgba(0, 0, 0, 0.08); /* Subtle border for better visibility */
}

body.light-theme .calculator-result-label {
    color: rgba(0, 0, 0, 0.6);
}

body.light-theme .calculator-result-value {
    color: #000000;
}

body.light-theme .calculator-result-highlight {
    color: #10B981;
}

body.light-theme .calculator-result-formula {
    color: rgba(0, 0, 0, 0.7);
}

/* Light theme: All text elements in calculator modals - ensure black text */
body.light-theme .calculator-modal-content,
body.light-theme .calculator-modal-content p,
body.light-theme .calculator-modal-content span,
body.light-theme .calculator-modal-content div:not(.calculator-input-group):not(.calculator-form-group),
body.light-theme .calculator-content,
body.light-theme .calculator-content p,
body.light-theme .calculator-content span,
body.light-theme .calculator-content div:not(.calculator-input-group):not(.calculator-form-group) {
    color: #000000 !important;
}

/* Light theme: Calculator form text elements */
body.light-theme .calculator-form p,
body.light-theme .calculator-form span,
body.light-theme .calculator-form div:not(.calculator-input-group) {
    color: #000000 !important;
}

/* Light theme: Invoice text selection - black background with white text */
body.light-theme .calculator-modal#invoiceModal ::selection,
body.light-theme .calculator-modal#invoiceModal ::-moz-selection {
    background: #000000;
    color: #ffffff;
}

/* Light theme: Calculator modals text selection - black background with white text */
body.light-theme .calculator-modal ::selection,
body.light-theme .calculator-modal ::-moz-selection {
    background: #000000;
    color: #ffffff;
}

body.light-theme .calculator-loading {
    color: rgba(0, 0, 0, 0.6);
}

body.light-theme .calculator-error {
    color: #dc2626;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

body.light-theme .calculator-result-placeholder .result-value {
    color: rgba(0, 0, 0, 0.3);
}

body.light-theme .calculator-result-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Light theme: Result item, label and value styles */
body.light-theme .result-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-theme .result-label {
    color: rgba(0, 0, 0, 0.6) !important;
}

body.light-theme .result-value {
    color: #000000 !important;
}

body.light-theme .result-value.positive {
    color: #10B981 !important;
}

body.light-theme .result-value.negative {
    color: #dc2626 !important;
}

body.light-theme .result-value.highlight {
    color: #000000 !important;
}

/* Invoice form inputs - same as chat input in light theme */
body.light-theme .invoice-form-group input,
body.light-theme .invoice-form-group textarea {
    background: rgb(240, 240, 240);
    border: 1px solid transparent;
    color: #000000;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

body.light-theme .invoice-form-group input:focus,
body.light-theme .invoice-form-group textarea:focus {
    background: rgb(232, 232, 232);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .invoice-form-group input:hover,
body.light-theme .invoice-form-group textarea:hover {
    background: rgb(232, 232, 232);
}

body.light-theme .invoice-form-group input.error,
body.light-theme .invoice-form-group textarea.error,
body.light-theme .invoice-item-row input.error {
    border: 1px solid rgba(255, 68, 68, 0.5);
    background: rgba(255, 68, 68, 0.05);
}

body.light-theme .invoice-form-group label {
    color: rgba(0, 0, 0, 0.8);
}

body.light-theme .invoice-items-header-row .invoice-form-group label {
    color: rgba(0, 0, 0, 0.8);
}

body.light-theme .invoice-form-section-title {
    color: #000000;
}

body.light-theme .invoice-error-message {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #dc2626;
}

/* Invoice modal in light theme */
body.light-theme .calculator-modal#invoiceModal .calculator-modal-content {
    background: rgb(248, 248, 248); /* Light gray background, lighter than inputs */
}

body.light-theme .calculator-modal#invoiceModal .calculator-modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Light theme: Calculator button container (footer) - light instead of dark */
body.light-theme .calculator-button-container {
    background: rgb(248, 248, 248); /* Same as modal background */
}

/* Light theme: Invoice file upload borders - black instead of white */
body.light-theme .invoice-file-label {
    border: 1px dashed rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.7);
}

body.light-theme .invoice-file-label:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.3);
    color: #000000;
}

body.light-theme .invoice-file-info {
    background: rgba(0, 0, 0, 0.02);
    border: 1px dashed rgba(0, 0, 0, 0.2);
}

body.light-theme .invoice-add-item-btn {
    background: rgba(0, 0, 0, 0.02);
    border: 1px dashed rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.7);
}

body.light-theme .invoice-add-item-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.3);
    color: #000000;
}

/* Calculator close button in light theme */
body.light-theme .calculator-close {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .calculator-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

body.light-theme .calculator-close .close-icon {
    filter: brightness(0) opacity(0.7);
}

body.light-theme .calculator-close:hover .close-icon {
    filter: brightness(0) opacity(1);
}

.content-main-title {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
    margin: 0 0 var(--spacing-5xl) 0;
    padding: 0;
    letter-spacing: -0.5px;
    font-family: var(--font-serif);
}

.content-main-title {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    padding: var(--spacing-6xl) 0 var(--spacing-6xl) 0;
    letter-spacing: -0.3px;
    font-family: var(--font-serif);
}

.content-block-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    line-height: 2;
    color: var(--color-text-tertiary);
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
}

.tool-category {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-4xl);
}

.tool-category:last-child {
    margin-bottom: 0;
}

.tool-category-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-relaxed);
    font-family: var(--font-primary);
    margin: 0;
    padding: 0;
}

/* Dark theme: category label gray text */
body:not(.light-theme) .tool-category-title {
    color: rgba(199, 199, 199, 0.8);
}

/* Light theme: category label gray text */
body.light-theme .tool-category-title {
    color: rgba(135, 135, 135, 0.8);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
}

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--background-color);
    box-shadow: 0px var(--card-box-shadow-1-y) var(--card-box-shadow-1-blur) var(--card-box-shadow-1), 0px var(--card-box-shadow-2-y) var(--card-box-shadow-2-blur) var(--card-box-shadow-2), 0 0 0 1px var(--card-border-color);
    padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-lg) var(--spacing-lg);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: box-shadow var(--transition-slow);
    z-index: 2;
    overflow: hidden;
}

.tool-card pixel-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to right, transparent, black);
    mask-image: linear-gradient(to right, transparent, black);
}

.tool-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    background: var(--card-background-color);
    z-index: 0;
}

/* Dark theme: card background same as overall background */
body:not(.light-theme) .tool-card::before {
    background: #1A1A1A;
}

.tool-card:hover {
    box-shadow: 0px 3px 6px var(--card-hover-box-shadow-1), 0px var(--card-hover-box-shadow-2-y) var(--card-hover-box-shadow-2-blur) var(--card-hover-box-shadow-2), 0 0 0 1px var(--card-hover-border-color);
}

.tool-card .icon {
    z-index: 2;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--spacing-5xl);
    height: var(--spacing-5xl);
}

.tool-card .icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: var(--card-icon-background-color);
    backdrop-filter: blur(2px);
    transition: background-color var(--transition-slow);
}

.tool-card .icon svg {
    position: relative;
    z-index: 1;
    display: block;
    width: var(--spacing-2xl);
    height: var(--spacing-2xl);
    transform: translateZ(0);
    color: var(--card-icon-color);
    transition: color var(--transition-slow);
}

.tool-card:hover .icon::after {
    background-color: var(--card-hover-icon-background-color);
}

.tool-card:hover .icon svg {
    color: var(--card-hover-icon-color);
}

.tool-card h4 {
    z-index: 2;
    position: relative;
    margin: var(--spacing-sm) 0 2px 0;
    font-family: var(--font-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-md);
    line-height: var(--line-height-normal);
    color: var(--card-label-color);
}

.tool-card:hover h4 {
    color: var(--card-hover-icon-color);
}

.tool-card p {
    z-index: 2;
    position: relative;
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
    font-family: var(--font-primary);
    margin-top: var(--spacing-sm);
    color: rgba(77, 77, 77, 0.9);
}

.tool-card .shine {
    border-radius: inherit;
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    opacity: 0;
    transition: opacity .5s;
    pointer-events: none;
}

.tool-card .shine:before {
    content: '';
    width: 150%;
    padding-bottom: 150%;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    bottom: 55%;
    filter: blur(35px);
    opacity: var(--card-shine-opacity);
    transform: translateX(-50%);
    background-image: var(--card-shine-gradient);
}

.tool-card:hover .shine {
    opacity: 1;
    transition-duration: .5s;
    transition-delay: 0s;
}

.tool-card .background {
    border-radius: inherit;
    position: absolute;
    inset: 0;
    overflow: hidden;
    -webkit-mask-image: radial-gradient(circle at 60% 5%, black 0%, black 15%, transparent 60%);
    mask-image: radial-gradient(circle at 60% 5%, black 0%, black 15%, transparent 60%);
}

.tool-card .background .tiles {
    opacity: 0;
    transition: opacity .25s;
}

.tool-card .background .tiles .tile {
    position: absolute;
    background-color: var(--card-tile-color);
    animation-duration: 8s;
    animation-iteration-count: infinite;
    opacity: 0;
}

.tool-card .background .tiles .tile.tile-4,
.tool-card .background .tiles .tile.tile-6,
.tool-card .background .tiles .tile.tile-10 {
    animation-delay: -2s;
}

.tool-card .background .tiles .tile.tile-3,
.tool-card .background .tiles .tile.tile-5,
.tool-card .background .tiles .tile.tile-8 {
    animation-delay: -4s;
}

.tool-card .background .tiles .tile.tile-2,
.tool-card .background .tiles .tile.tile-9 {
    animation-delay: -6s;
}

.tool-card .background .tiles .tile.tile-1 {
    top: 0;
    left: 0;
    height: 10%;
    width: 22.5%;
}

.tool-card .background .tiles .tile.tile-2 {
    top: 0;
    left: 22.5%;
    height: 10%;
    width: 27.5%;
}

.tool-card .background .tiles .tile.tile-3 {
    top: 0;
    left: 50%;
    height: 10%;
    width: 27.5%;
}

.tool-card .background .tiles .tile.tile-4 {
    top: 0;
    left: 77.5%;
    height: 10%;
    width: 22.5%;
}

.tool-card .background .tiles .tile.tile-5 {
    top: 10%;
    left: 0;
    height: 22.5%;
    width: 22.5%;
}

.tool-card .background .tiles .tile.tile-6 {
    top: 10%;
    left: 22.5%;
    height: 22.5%;
    width: 27.5%;
}

.tool-card .background .tiles .tile.tile-7 {
    top: 10%;
    left: 50%;
    height: 22.5%;
    width: 27.5%;
}

.tool-card .background .tiles .tile.tile-8 {
    top: 10%;
    left: 77.5%;
    height: 22.5%;
    width: 22.5%;
}

.tool-card .background .tiles .tile.tile-9 {
    top: 32.5%;
    left: 50%;
    height: 22.5%;
    width: 27.5%;
}

.tool-card .background .tiles .tile.tile-10 {
    top: 32.5%;
    left: 77.5%;
    height: 22.5%;
    width: 22.5%;
}

@keyframes tile {
    0%, 12.5%, 100% {
        opacity: 1;
    }
    25%, 82.5% {
        opacity: 0;
    }
}

.tool-card .background .line {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .35s;
}

.tool-card .background .line:before,
.tool-card .background .line:after {
    content: '';
    position: absolute;
    background-color: var(--card-line-color);
    transition: transform .35s;
}

.tool-card .background .line:before {
    left: 0;
    right: 0;
    height: 1px;
    transform-origin: 0 50%;
    transform: scaleX(0);
}

.tool-card .background .line:after {
    top: 0;
    bottom: 0;
    width: 1px;
    transform-origin: 50% 0;
    transform: scaleY(0);
}

.tool-card .background .line.line-1:before {
    top: 10%;
}

.tool-card .background .line.line-1:after {
    left: 22.5%;
}

.tool-card .background .line.line-1:before,
.tool-card .background .line.line-1:after {
    transition-delay: .3s;
}

.tool-card .background .line.line-2:before {
    top: 32.5%;
}

.tool-card .background .line.line-2:after {
    left: 50%;
}

.tool-card .background .line.line-2:before,
.tool-card .background .line.line-2:after {
    transition-delay: .15s;
}

.tool-card .background .line.line-3:before {
    top: 55%;
}

.tool-card .background .line.line-3:after {
    right: 22.5%;
}

.tool-card:hover .background .tiles {
    opacity: 1;
    transition-delay: .25s;
}

.tool-card:hover .background .tiles .tile {
    animation-name: tile;
}

.tool-card:hover .background .line {
    opacity: 1;
    transition-duration: .15s;
}

.tool-card:hover .background .line:before {
    transform: scaleX(1);
}

.tool-card:hover .background .line:after {
    transform: scaleY(1);
}

.tool-card:hover .background .line.line-1:before,
.tool-card:hover .background .line.line-1:after {
    transition-delay: .0s;
}

.tool-card:hover .background .line.line-2:before,
.tool-card:hover .background .line.line-2:after {
    transition-delay: .15s;
}

.tool-card:hover .background .line.line-3:before,
.tool-card:hover .background .line.line-3:after {
    transition-delay: .3s;
}

/* Removed special styles for tool-card-generator - using standard card styles */

/* Responsiveness for cards */
@media (max-width: 1024px) {
    .content-block {
        padding: 0 24px;
        margin: 0;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
    
    .tool-card {
        padding: 20px 16px;
        min-height: 130px;
    }
}

@media (max-width: 768px) {
    .content-block {
        padding: 0 16px;
        margin: 0;
        border-radius: 16px;
    }
    
    .content-main-title {
        font-size: 32px;
        padding-bottom: 24px;
    }
    
    .content-block-title {
        font-size: 22px;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .tool-card {
        padding: 18px 14px;
        min-height: 120px;
        gap: 10px;
        display: flex;
        flex-direction: column;
    }

    
    .tool-card-icon {
        width: 48px;
        height: 48px;
    }
    
    .tool-card-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .tool-card h4 {
        font-size: 14px;
    }
    
    .tool-card p {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tool-card {
        min-height: 110px;
    }
}

/* Mobile styles for appsuite.html - ensure cards are visible */
@media (min-width: 320px) and (max-width: 800px) {
    /* Ensure center-content with tool cards is visible on mobile */
    .center-content:has(.tool-card),
    .center-content:has(.tools-grid),
    .center-content:has(.content-block) {
        display: flex !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: calc(100vh - 56px - env(safe-area-inset-top)) !important;
        width: 100% !important;
        position: fixed !important;
        top: calc(56px + env(safe-area-inset-top)) !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 25 !important; /* Above chat (z-index: 20/30) */
        pointer-events: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Ensure content-block is visible and properly styled on mobile */
    .center-content:has(.content-block) .content-block {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-6xl) var(--spacing-lg) !important;
        margin: 0 !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        height: auto !important;
        min-height: 100% !important;
        pointer-events: auto !important;
    }
    
    /* Reduce padding-bottom for content-main-title on mobile */
    .content-main-title {
        padding-bottom: 24px !important;
    }
    
    /* Ensure tools-grid is visible */
    .tools-grid {
        display: grid !important;
    }
    
    /* Ensure tool cards are visible */
    .tool-card {
        display: flex !important;
    }
}

