:root {
    --ai-primary-color: #4A5DE2;
    --ai-text-color: #4A4A4A;
    --ai-bg-color: #FFFFFF;
    --ai-border-color: #E3E3FA;
    --ai-shadow: 0 0 0.625rem 0 #00000033;
    --ai-light-bg: #F9F9FC;
}

.ai-response {
    background: var(--ai-bg-color);
    border: 1px solid var(--ai-border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.25rem 0 1.875rem;
    box-shadow: var(--ai-shadow);
    color: var(--ai-text-color);

    & .ai-response__spinner {
        margin-top: 1.5rem;
        display: inline-block;
        width: 3rem;
        height: 3rem;
        border: 3px solid var(--ai-border-color);
        border-top-color: var(--ai-primary-color);
        border-radius: 50%;
        animation: ai-spinner 1s linear infinite;
    }


    & .ai-response__header {
        display: flex;
        align-items: center;
        margin-bottom: 1rem;
        gap: 0.75rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--ai-border-color);
    }

    & .ai-response__icon {
        width: 2rem;
        height: 2rem;
        color: var(--ai-primary-color);
        flex-shrink: 0;
        background-size: contain;
        background-image: url('data:image/svg+xml,<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M35.4248 24.9973C35.2078 25.1921 34.9853 25.3855 34.758 25.5774C34.7517 25.7225 34.7336 25.8553 34.7056 25.9786C34.6701 26.1338 34.6195 26.2747 34.5508 26.4122C34.488 26.5375 34.4132 26.6537 34.3212 26.7678C34.2407 26.8676 34.1468 26.9657 34.0352 27.0635C33.8402 27.2344 33.5894 27.4048 33.271 27.5649C33.0325 27.6849 32.7565 27.7985 32.4441 27.9003C32.3871 27.919 32.3288 27.9372 32.2693 27.9549C31.8142 29.8734 31.1982 31.6506 30.4336 33.2497C30.9688 33.2084 31.4926 33.1465 32.0039 33.0625C32.78 32.9348 33.5277 32.7563 34.2418 32.5185C34.7773 32.34 35.294 32.128 35.787 31.8773C36.526 31.5015 37.2137 31.0371 37.8139 30.4726C38.1138 30.1906 38.3911 29.884 38.6397 29.5545C38.8882 29.225 39.1079 28.8727 39.2933 28.5022C39.5345 28.0207 39.7131 27.5172 39.8293 27.0064C39.9458 26.4954 40.0003 25.9775 40.0002 25.463C40.0001 24.6858 39.8771 23.9176 39.6606 23.1682C39.4709 22.512 39.2095 21.8691 38.8886 21.2382C38.8805 21.2222 38.872 21.2064 38.8638 21.1904C38.5206 21.6786 38.1423 22.1653 37.73 22.6485C37.0515 23.4431 36.2759 24.2333 35.4248 24.9973Z" fill="url(%23paint0_linear_2739_11792)"/><path d="M18.197 5.61971C18.5503 5.35301 18.879 5.1772 19.1734 5.06938C19.3211 5.01529 19.4609 4.97763 19.5967 4.95287C19.7326 4.92821 19.8646 4.91627 19.9997 4.9162C20.1422 4.91628 20.281 4.92951 20.4246 4.95696C20.6927 5.00866 20.9822 5.11113 21.3063 5.29281C21.5888 5.45142 21.895 5.67148 22.2112 5.96059C22.2927 6.03503 22.3749 6.11457 22.4574 6.19804C24.5038 5.76848 26.4796 5.53622 28.3456 5.50601C28.2165 5.2951 28.0842 5.08824 27.948 4.88611C27.4832 4.19633 26.9767 3.55824 26.4218 2.98041C26.0055 2.5472 25.5618 2.14788 25.0868 1.78924C24.3749 1.25183 23.5897 0.804454 22.7324 0.49012C22.3041 0.333112 21.8585 0.20996 21.4007 0.126664C20.9434 0.0433453 20.474 4.02246e-06 20.0011 1.12031e-10H19.9983C19.5 -2.68145e-06 19.0058 0.0481339 18.5255 0.140374C17.6227 0.313247 16.7736 0.640726 16.0014 1.07502C15.3248 1.45536 14.7042 1.91667 14.133 2.43838C13.6332 2.89516 13.1707 3.39874 12.7403 3.9422C12.3529 4.43196 11.9914 4.95431 11.6538 5.50601C13.5197 5.53621 15.4954 5.76844 17.5419 6.198C17.7647 5.9726 17.9848 5.77982 18.197 5.61971Z" fill="%23002697"/><path d="M9.24154 32.5403C8.62646 31.132 8.11909 29.5914 7.73095 27.9557C7.65601 27.9333 7.58285 27.9102 7.51173 27.8865C7.20907 27.7857 6.94153 27.6737 6.70985 27.5559C6.36175 27.3788 6.09621 27.19 5.89568 27.0014C5.79518 26.9068 5.7103 26.8119 5.63713 26.7149C5.56399 26.6179 5.50237 26.5187 5.44936 26.413C5.38068 26.2754 5.3301 26.1345 5.2946 25.9794C5.26655 25.8561 5.24849 25.7232 5.24216 25.578C5.24054 25.5407 5.2395 25.5028 5.23948 25.4638C5.23936 25.1762 5.28557 24.8391 5.39648 24.4555C5.42263 24.3649 5.45271 24.2717 5.48617 24.1763C5.57656 23.9186 5.69366 23.6442 5.84002 23.3567C6.09576 22.8531 6.44119 22.3103 6.87241 21.7482C6.86355 21.5608 6.85558 21.3731 6.84958 21.1848L6.83071 20.0005L6.8496 18.8161C6.85562 18.6278 6.86356 18.4401 6.87244 18.2526C6.90475 17.5703 6.95584 16.8935 7.02591 16.2239C7.09193 15.5931 7.17459 14.9685 7.27387 14.3516C7.02439 14.5416 6.78001 14.7334 6.54112 14.9271C6.17686 15.2223 5.82507 15.5216 5.48626 15.8246C5.47353 15.836 5.46059 15.8473 5.44789 15.8587C4.64028 16.5837 3.90678 17.3293 3.25516 18.0922C2.72234 18.7168 2.24392 19.3527 1.82625 20.0007C1.57343 20.393 1.34259 20.7896 1.13626 21.1911C1.05862 21.3421 0.98435 21.4938 0.913607 21.6462C0.629476 22.2596 0.40256 22.8845 0.245057 23.5216C0.0877381 24.1584 3.93658e-05 24.8081 6.97217e-08 25.4637C-7.11396e-05 25.9782 0.0544026 26.4961 0.170887 27.0071C0.287116 27.518 0.465742 28.0215 0.706932 28.503C0.92665 28.9422 1.19454 29.3556 1.50156 29.7359C1.77016 30.0689 2.06844 30.3766 2.38947 30.6578C2.95161 31.1502 3.58183 31.5607 4.25431 31.8988C4.75899 32.1526 5.28808 32.3662 5.83662 32.545C6.65964 32.8131 7.52645 33.0036 8.42983 33.1289C8.80261 33.1804 9.18179 33.2207 9.5668 33.2504C9.45534 33.0176 9.34676 32.781 9.24154 32.5403Z" fill="%2300A9FF"/><path d="M32.7264 14.3506C32.2542 13.991 31.7632 13.6382 31.2546 13.293C31.0679 13.1662 30.8788 13.0405 30.6874 12.9159C30.5249 12.8101 30.361 12.7048 30.1951 12.6006C29.6521 12.2594 29.0909 11.9271 28.5132 11.6044C27.4206 10.9941 26.2683 10.4187 25.062 9.88704C24.9509 9.83809 24.8398 9.7899 24.7287 9.74208C24.1507 9.4933 23.5727 9.25965 22.9957 9.04126C21.9917 8.66118 20.991 8.32715 20 8.03882C19.3314 7.84429 18.6672 7.6706 18.0094 7.5177C17.9795 7.51075 17.9495 7.50364 17.9196 7.49677C17.889 7.48976 17.8585 7.48298 17.828 7.47606C17.441 7.38834 17.0563 7.30775 16.6742 7.23444C14.7888 6.87268 12.9668 6.68709 11.2459 6.68652C11.1602 6.68654 11.0748 6.68717 10.9896 6.68811C10.507 6.69342 10.0325 6.71356 9.56663 6.7495C9.03143 6.79079 8.50765 6.85274 7.99636 6.93673C7.22023 7.06445 6.47252 7.2429 5.75837 7.48075C5.22288 7.65921 4.70621 7.87125 4.21316 8.12196C3.47417 8.49773 2.78646 8.96211 2.18629 9.52661C1.88644 9.80859 1.60911 10.1152 1.36056 10.4448C1.11197 10.7742 0.892339 11.1265 0.706925 11.497C0.465742 11.9785 0.287116 12.482 0.170887 12.9929C0.0544026 13.5039 -7.11396e-05 14.0218 6.97217e-08 14.5362C0.000119149 15.3134 0.123096 16.0817 0.339605 16.8311C0.529322 17.4872 0.790725 18.1301 1.11158 18.761C1.1197 18.777 1.12824 18.7929 1.13644 18.8088C1.47963 18.3207 1.85789 17.834 2.27018 17.3507C2.9488 16.5561 3.72436 15.7659 4.57542 15.0019C4.79244 14.8071 5.01487 14.6137 5.24217 14.4219C5.2485 14.2767 5.26656 14.1439 5.2946 14.0206C5.3301 13.8655 5.38068 13.7246 5.44935 13.5871C5.51222 13.4617 5.58705 13.3455 5.67901 13.2314C5.75952 13.1317 5.85342 13.0335 5.96503 12.9357C6.16 12.7649 6.4108 12.5945 6.72925 12.4343C6.96776 12.3143 7.24369 12.2007 7.5561 12.0989C7.61315 12.0803 7.67147 12.0621 7.73093 12.0443C8.06104 11.9455 8.42805 11.86 8.82784 11.7915C8.91694 11.7762 9.00764 11.7618 9.09997 11.7482C9.13141 11.7436 9.16291 11.7391 9.19472 11.7347C9.81386 11.6489 10.5019 11.6027 11.2439 11.6027H11.2459C11.2485 11.6027 11.251 11.6027 11.2536 11.6027C11.3305 11.6027 11.4081 11.6034 11.4861 11.6044C12.4157 11.6163 13.4246 11.6993 14.4885 11.8573C14.8969 11.9179 15.3134 11.9895 15.7365 12.0724C16.0456 12.133 16.3582 12.1994 16.6739 12.272C17.7531 12.5197 18.868 12.838 20 13.2267C20.5972 13.4318 21.1991 13.6565 21.803 13.901C22.1464 14.0399 22.4904 14.1851 22.8346 14.3369C23.5983 14.6734 24.3354 15.0297 25.0432 15.4011C25.5184 15.6505 25.9807 15.9067 26.4281 16.1688C26.9441 16.4712 27.4411 16.7811 27.9173 17.097C28.9303 17.7688 29.849 18.4672 30.6587 19.1708C31.0114 18.8264 31.3375 18.4807 31.6333 18.1371C31.7054 18.0534 31.7758 17.9696 31.8446 17.8858C32.3109 17.3172 32.6971 16.7487 32.9744 16.2225C32.9901 16.1925 33.0059 16.1626 33.021 16.1329C33.1819 15.8167 33.3044 15.5146 33.3853 15.2344C33.416 15.1283 33.4403 15.025 33.4587 14.9258C33.2199 14.7323 32.9757 14.5405 32.7264 14.3506Z" fill="url(%23paint1_linear_2739_11792)"/><path d="M39.8291 12.9929C39.7129 12.482 39.5342 11.9785 39.2931 11.4971C39.0733 11.0579 38.8054 10.6444 38.4984 10.2641C38.2298 9.93111 37.9315 9.62337 37.6105 9.3422C37.0484 8.84979 36.4182 8.43931 35.7457 8.10115C35.241 7.84742 34.7119 7.63382 34.1634 7.45496C33.3403 7.18684 32.4735 6.99637 31.5702 6.87114C31.1974 6.81956 30.8182 6.77931 30.4332 6.7496C29.9674 6.71366 29.4929 6.69341 29.0104 6.68811C28.9252 6.68717 28.8398 6.68653 28.7541 6.68652C27.0333 6.68709 25.2112 6.87268 23.3258 7.23443C22.9437 7.30774 22.559 7.38833 22.172 7.47606C22.7474 7.67266 23.3219 7.88315 23.8946 8.107C24.4646 8.32982 25.033 8.56582 25.5986 8.81505C27.4514 9.63163 29.2209 10.5661 30.8592 11.5927C30.8719 11.6007 30.8848 11.6086 30.8975 11.6166C30.9899 11.6746 31.0817 11.733 31.1732 11.7916C31.5727 11.86 31.9392 11.9457 32.269 12.0443C32.344 12.0667 32.4171 12.0898 32.4883 12.1135C32.7909 12.2143 33.0584 12.3263 33.2901 12.4441C33.6382 12.6212 33.9038 12.81 34.1043 12.9986C34.2048 13.0932 34.2897 13.1881 34.3629 13.2851C34.436 13.3821 34.4976 13.4812 34.5506 13.587C34.6193 13.7245 34.6699 13.8654 34.7054 14.0206C34.7334 14.1439 34.7515 14.2768 34.7578 14.422C34.7594 14.4593 34.7605 14.4972 34.7605 14.5363C34.7606 14.8238 34.7144 15.1609 34.6035 15.5445C34.5773 15.6351 34.5473 15.7283 34.5138 15.8237C34.4234 16.0814 34.3063 16.3558 34.1599 16.6433C33.9043 17.1468 33.559 17.6893 33.128 18.2512C32.9685 18.4591 32.7977 18.6696 32.6148 18.8818C32.3947 19.1374 32.1579 19.3955 31.9052 19.6549C31.7934 19.7696 31.6785 19.8846 31.5604 19.9996C31.3299 20.2245 31.0877 20.4497 30.8341 20.6746C30.7763 20.7259 30.7177 20.7772 30.6587 20.8285C29.6823 21.6769 28.5472 22.5174 27.2798 23.3136C27.0022 23.488 26.718 23.6602 26.428 23.8301C25.9807 24.0922 25.519 24.3484 25.0439 24.5977C24.3359 24.9693 23.5985 25.3256 22.8345 25.6622C22.4904 25.814 22.1464 25.9592 21.803 26.0981C21.1991 26.3426 20.5972 26.5673 20 26.7723C18.868 27.1611 17.7531 27.4793 16.6739 27.7271C16.4696 27.7741 16.2667 27.8183 16.0652 27.8602C15.9555 27.8831 15.8461 27.9052 15.7373 27.9265C15.7752 28.0465 15.8139 28.1655 15.8534 28.2833C16.0995 29.0167 16.3774 29.7062 16.6813 30.3326C16.7852 30.547 16.8932 30.7558 17.0042 30.9578C17.3057 31.5063 17.6304 32.0038 17.96 32.4197C17.9765 32.4406 17.9931 32.4608 18.0096 32.4813C18.6674 32.3284 19.3315 32.1548 20 31.9603C20.9912 31.6719 21.992 31.3378 22.9963 30.9576C23.573 30.7393 24.1508 30.5057 24.7286 30.2571C24.8397 30.2092 24.9508 30.161 25.062 30.1121C26.2684 29.5803 27.4213 29.0051 28.5139 28.3947C29.2679 27.9735 29.9928 27.5354 30.6872 27.0833C30.7723 27.0279 30.8575 26.9724 30.9417 26.9165C31.0468 26.8468 31.1509 26.7767 31.2545 26.7063C31.7633 26.3609 32.2542 26.0079 32.7264 25.6482C32.9758 25.4582 33.2201 25.2665 33.4589 25.0729C33.8231 24.7777 34.1749 24.4784 34.5137 24.1754C34.5264 24.164 34.5394 24.1527 34.5521 24.1413C35.3597 23.4163 36.0932 22.6707 36.7448 21.9078C37.2776 21.2832 37.7561 20.6473 38.1737 19.9993C38.4265 19.607 38.6574 19.2104 38.8637 18.8089C38.9413 18.6579 39.0156 18.5062 39.0864 18.3538C39.3705 17.7404 39.5974 17.1155 39.7549 16.4784C39.9122 15.8416 39.9999 15.1918 40 14.5363C40 14.0218 39.9456 13.5039 39.8291 12.9929Z" fill="%2300A9FF"/><path d="M26.7329 30.6645C26.7329 30.6645 25.5897 31.1879 25.5854 31.1898L24.4479 31.6715C24.2638 31.7465 24.0794 31.8195 23.8948 31.8916C23.7715 32.0996 23.6462 32.2983 23.5193 32.4866C23.4551 32.5819 23.3905 32.6746 23.3256 32.7647C23.0625 33.1301 22.7949 33.4521 22.5301 33.7276C22.5059 33.7527 22.4818 33.7772 22.4577 33.8016C22.2349 34.027 22.0148 34.2197 21.8026 34.3799C21.4493 34.6466 21.1206 34.8224 20.8261 34.9302C20.6785 34.9843 20.5386 35.0219 20.4029 35.0467C20.267 35.0714 20.135 35.0833 19.9998 35.0834C19.8574 35.0833 19.7186 35.0701 19.575 35.0426C19.3069 34.9909 19.0174 34.8884 18.6933 34.7068C18.4107 34.5481 18.1046 34.3281 17.7883 34.039C17.7068 33.9645 17.6247 33.885 17.5421 33.8015C17.3446 33.6017 17.1449 33.3766 16.9465 33.1259C16.8553 33.0107 16.7643 32.8903 16.674 32.7647C16.4811 32.4967 16.2907 32.2049 16.105 31.8917C15.9078 31.5591 15.7159 31.2023 15.532 30.8225C15.4431 30.6392 15.3561 30.4505 15.2711 30.2571C15.208 30.1133 15.146 29.9668 15.0852 29.8177C15.0852 29.8177 15.0852 29.8177 15.0852 29.8177C14.8703 29.2908 14.6704 28.7308 14.4884 28.1418C14.3732 27.769 14.2652 27.3847 14.1652 26.9899C14.0822 26.6622 14.0047 26.3274 13.9332 25.986C13.7877 25.293 13.6664 24.5728 13.5718 23.8303C13.5091 23.3387 13.4581 22.8374 13.4195 22.3276C13.3621 21.5687 13.3322 20.7912 13.3322 19.9996C13.3322 19.208 13.3622 18.4304 13.4196 17.6714C13.4581 17.1617 13.5091 16.6605 13.5718 16.169C13.6818 15.3056 13.8279 14.4723 14.0061 13.6769C14.0566 13.4512 14.11 13.2288 14.1656 13.0093C13.1422 12.8629 12.1585 12.7871 11.2534 12.7871H11.2438C11.0352 12.7871 10.8311 12.7915 10.6307 12.7993C10.6311 12.799 10.6315 12.7987 10.632 12.7984C10.4591 12.8044 10.2852 12.8151 10.1167 12.8286C9.862 12.8479 9.61519 12.8736 9.3785 12.9064C9.35957 12.909 9.34083 12.9118 9.32206 12.9145C9.05023 12.9514 8.85813 12.9859 8.8119 12.9995C8.77214 13.1249 8.65433 13.7621 8.65433 13.7621L8.65458 13.7621C8.40901 15.0827 8.23984 16.462 8.15534 17.8856C8.12076 18.4682 8.10034 19.0583 8.09462 19.6547C8.09352 19.7695 8.09278 19.8844 8.09277 19.9996C8.09279 20.1147 8.09354 20.2296 8.09464 20.3443C8.10037 20.9407 8.1207 21.5307 8.15528 22.1133C8.24981 23.7064 8.4501 25.2442 8.74525 26.7062C8.76487 26.8033 8.78502 26.9001 8.80546 26.9965C8.82933 27.1092 8.8536 27.2214 8.87859 27.3331C8.94797 27.6427 9.02178 27.9486 9.09971 28.2508C9.11314 28.3028 9.12692 28.3546 9.14061 28.4065C9.48508 29.7117 9.90908 30.9449 10.4093 32.0903C10.5924 32.5091 10.7857 32.9162 10.9894 33.311C11.1997 33.7187 11.4212 34.1131 11.654 34.4935C11.7831 34.7045 11.9154 34.9113 12.0516 35.1135C12.5164 35.8032 13.0229 36.4413 13.5778 37.0192C13.9941 37.4524 14.4378 37.8517 14.9128 38.2103C15.6247 38.7477 16.4098 39.1951 17.2672 39.5095C17.6955 39.6664 18.1411 39.7896 18.5989 39.8729C19.0563 39.9562 19.5257 39.9996 19.9988 39.9996L19.9998 39.9996L20.0012 39.9996C20.4995 39.9996 20.9937 39.9514 21.4741 39.8592C22.3768 39.6863 23.226 39.3588 23.9982 38.9246C24.6748 38.5442 25.2954 38.0829 25.8666 37.5612C26.3664 37.1044 26.8289 36.6008 27.2592 36.0574C27.6467 35.5676 28.0082 35.0453 28.3458 34.4936C28.5786 34.1131 28.8 33.7187 29.0103 33.311C29.0874 33.1615 29.1631 33.0103 29.2373 32.8574C29.8939 31.5012 30.4367 30.0081 30.8594 28.4061C29.5579 29.2217 28.1766 29.9779 26.7329 30.6645Z" fill="%23002697"/><path d="M16.7555 21.4758C17.6391 21.4758 18.3553 20.8037 18.3553 19.9747C18.3553 19.1457 17.6391 18.4736 16.7555 18.4736C15.872 18.4736 15.1558 19.1457 15.1558 19.9747C15.1558 20.8037 15.872 21.4758 16.7555 21.4758Z" fill="%23002697"/><path d="M26.5827 21.4758C27.4662 21.4758 28.1825 20.8037 28.1825 19.9747C28.1825 19.1457 27.4662 18.4736 26.5827 18.4736C25.6992 18.4736 24.9829 19.1457 24.9829 19.9747C24.9829 20.8037 25.6992 21.4758 26.5827 21.4758Z" fill="%23002697"/><path d="M21.6691 21.4758C22.5527 21.4758 23.2689 20.8037 23.2689 19.9747C23.2689 19.1457 22.5527 18.4736 21.6691 18.4736C20.7856 18.4736 20.0693 19.1457 20.0693 19.9747C20.0693 20.8037 20.7856 21.4758 21.6691 21.4758Z" fill="%23002697"/><defs><linearGradient id="paint0_linear_2739_11792" x1="2.41607" y1="8.39699" x2="37.3325" y2="31.5572" gradientUnits="userSpaceOnUse"><stop stop-color="%23002697"/><stop offset="1" stop-color="%230085FF"/></linearGradient><linearGradient id="paint1_linear_2739_11792" x1="2.6267" y1="8.079" x2="37.5431" y2="31.2392" gradientUnits="userSpaceOnUse"><stop stop-color="%23002697"/><stop offset="1" stop-color="%230085FF"/></linearGradient></defs></svg>');
    }

    & .ai-response__title {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--ai-text-color);
        flex-grow: 1;
    }

    & .ai-response__content {
        padding: 1.25rem 0;
        color: var(--ai-text-color);

        &.ai-response__content--no-relevant {
            text-align: center;
            & .ai-response__title{
                font-size: 1rem;
                font-weight: 600;
                margin-top: 1rem;
            }
            & .ai-response__message {
                font-size: 0.875rem;
                font-weight: 400;
                padding-top: 0.5rem;
                margin-block-start: 0;
            }
        }


    }

    & .ai-response__answer {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1rem;
        color: var(--ai-text-color);

        &.ai-response__answer--loading::after {
            content: 'Myślę';
            animation: ai-dots-blink 1.5s infinite, ai-loading-pulse 1.5s ease-in-out infinite;
            margin-left: 0.125rem;
        }

        &.ai-response__answer--streaming::after {
            content: '|';
            animation: ai-cursor-blink 1s infinite;
            margin-left: 0.125rem;
        }
        
        & .ai-citation-link {
            color: var(--ai-primary-color);
            text-decoration: none;
            font-weight: 500;
            padding: 0.125rem 0.25rem;
            border-radius: 0.25rem;
            transition: all 0.2s ease;
            
            &:hover {
                background: var(--ai-border-color);
                text-decoration: none;
            }
        }

        & p {
            margin: 0 0 0.75rem 0;

            &:last-child {
                margin-bottom: 0;
            }
        }
        & li{
            margin-left: 1rem;
        }

        & pre {
            background: var(--ai-light-bg);
            padding: 0.75rem;
            border-radius: 0.25rem;
            overflow-x: auto;
            font-size: 0.875rem;
            border: 1px solid var(--ai-border-color);
        }
    }

    & .ai-response__char {
        display: inline;
        animation: ai-char-fadein 0.3s ease-out forwards;
        opacity: 0;
    }

    & .ai-response__sources {
        margin-top: 1.25rem;
        padding-top: 1rem;
        border-top: 1px solid var(--ai-border-color);
        opacity: 0;
        transform: translateY(0.625rem);
        transition: opacity 0.5s ease-out, transform 0.5s ease-out;

        &.ai-response__sources--visible {
            opacity: 1;
            transform: translateY(0);
        }
    }

    & .ai-response__sources-title {
        margin: 0 0 0.75rem 0;
        font-size: 0.75rem;
        font-weight: 500;
        opacity: 0.6;
        text-transform: uppercase;
    }

    & .ai-response__sources-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(15.625rem, 1fr));
        gap: 0.75rem;
        margin: 0;
        padding: 0;
    }

    & .ai-response__source-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.75rem 1rem;
        min-width: 0;
        background: var(--ai-light-bg);
        border: 1px solid var(--ai-light-bg);
        border-radius: 0.5rem;
        text-decoration: none;
        color: var(--ai-text-color);
        transition: all 0.3s ease-out;
        opacity: 0;
        transform: translateY(1.25rem) scale(0.95);
        animation: ai-source-slidein 0.5s ease-out forwards;

        &:hover {
            border-color: var(--ai-primary-color);
            box-shadow: 0 0.125rem 0.5rem rgba(74, 93, 226, 0.15);
            transform: translateY(-0.125rem) scale(1);
        }
        
        &.ai-response__source-item--highlighted {
            border-color: var(--ai-primary-color);
            transform: translateY(0) scale(1.02);
            & .ai-response__source-title {
                color: var(--ai-primary-color);
            }
            & .ai-response__source-title,
            & .ai-response__source-url {
                opacity: 1;
            }
        }
    }

    & .ai-response__source-number {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.75rem;
        height: 1.25rem;
        background: var(--ai-primary-color);
        color: white;
        border-radius: 0.25rem;
        font-weight: 600;
        font-size: 0.6875rem;
        padding: 0 0.375rem;
        margin-bottom: 0.25rem;
    }

    & .ai-response__source-url {
        font-size: 0.625rem;
        line-height: 1;
        flex-shrink: 0;
        display: block;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        width: 100%;
        align-self: stretch;
        opacity: 0.6;
        
    }

    & .ai-response__source-title {
        flex: 1;
        font-size: 0.875rem;
        font-weight: 400;
        line-height: 1.4;
        color: var(--ai-text-color);
        display: block;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        width: 100%;
    }

    & .ai-response__footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-top: 1rem;
        margin-top: 1rem;
        border-top: 1px solid var(--ai-border-color);
    }

    & .ai-response__disclaimer {
        font-size: 0.75rem;
        color: var(--ai-text-color);
        opacity: 0.6;
        font-style: italic;
    }
}

@keyframes ai-spinner {
    to {
        transform: rotate(360deg);
    }
}

@keyframes ai-loading-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes ai-dots-blink {
    0% {
        content: 'Myślę';
    }
    25% {
        content: 'Myślę.';
    }
    50% {
        content: 'Myślę..';
    }
    75% {
        content: 'Myślę...';
    }
    100% {
        content: 'Myślę...';
    }
}

@keyframes ai-cursor-blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

@keyframes ai-char-fadein {
    from {
        opacity: 0;
        transform: translateY(0.3125rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ai-source-slidein {
    from {
        opacity: 0;
        transform: translateY(1.25rem) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 48rem) {
    .ai-response {
        padding: 1rem;
        margin: 0.9375rem 0 1.25rem;

        & .ai-response__title {
            font-size: 1.125rem;
        }

        & .ai-response__content {
            padding: 1rem 0;
        }

        & .ai-response__answer {
            font-size: 0.9375rem;
        }

        & .ai-response__sources-list {
            grid-template-columns: 1fr;
        }
    }
}

.text-center {
    text-align: center;
}
