* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f172a 100%);
    background-attachment: fixed;
    color: #ffffff;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 0;
    position: relative;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

/* Scrollable area: logo + responses above the input bar */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 20px 16px 24px;
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-name {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #e5e7eb 50%, #9ca3af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    text-align: center;
    animation: fadeInScale 0.8s ease-out;
    position: relative;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.app-name::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    border-radius: 2px;
    animation: expandLine 1s ease-out 0.5s both;
}

@keyframes expandLine {
    from {
        width: 0;
    }
    to {
        width: 60px;
    }
}

/* Fixed input bar at bottom – does not move with content */
.input-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(10, 10, 10, 0.98) 0%, rgba(10, 10, 10, 0.95) 70%, transparent 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.input-section .input-container {
    max-width: 800px;
    margin: 0 auto;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    padding: 14px 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.input-container:focus-within {
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: 
        0 0 0 4px rgba(59, 130, 246, 0.15),
        0 8px 32px rgba(59, 130, 246, 0.2);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.input-icons-left {
    display: flex;
    gap: 8px;
    margin-right: 12px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.icon-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.icon-btn:hover::before {
    width: 100%;
    height: 100%;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.icon-btn:active {
    transform: translateY(0);
}

.icon-btn svg {
    position: relative;
    z-index: 1;
}

.icon-btn:first-child {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.input-field {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 200px;
    overflow-y: auto;
}

.input-field::placeholder {
    color: #6b7280;
}

.input-icons-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 12px;
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(99, 102, 241, 0.2));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.send-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.send-btn:hover:not(:disabled)::before {
    width: 120%;
    height: 120%;
}

.send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(99, 102, 241, 0.4));
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.send-btn:active:not(:disabled) {
    transform: translateY(0) scale(1);
}

.send-btn svg {
    position: relative;
    z-index: 1;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.response-section {
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    position: relative;
}

.response-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.new-chat-btn {
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #9ca3af;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.new-chat-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.new-chat-btn:active {
    transform: translateY(0);
}

.copy-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.copy-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.copy-btn:active {
    transform: translateY(0) scale(0.95);
}

.copy-btn.copied {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(16, 185, 129, 0.3));
    border-color: rgba(34, 197, 94, 0.6);
    color: #22c55e;
    animation: copiedPulse 0.6s ease-out;
}

@keyframes copiedPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.response-content {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px;
    color: #e5e7eb;
    line-height: 1.7;
    word-wrap: break-word;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: slideInUp 0.4s ease-out;
    max-width: 100%;
}

.response-content .res-p {
    margin: 0 0 1em 0;
}
.response-content .res-p:last-child {
    margin-bottom: 0;
}
.response-content .res-h2 {
    font-size: 1.2em;
    font-weight: 700;
    margin: 1.25em 0 0.5em 0;
    color: #f3f4f6;
}
.response-content .res-h2:first-child {
    margin-top: 0;
}
.response-content .res-h3 {
    font-size: 1.05em;
    font-weight: 600;
    margin: 1em 0 0.4em 0;
    color: #e5e7eb;
}
.response-content .res-list {
    margin: 0.75em 0;
    padding-left: 1.5em;
    list-style: disc;
}
.response-content .res-list li {
    margin: 0.35em 0;
}
.response-content .res-pre {
    margin: 1em 0;
    white-space: pre-wrap;
    word-break: break-word;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.response-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.response-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.response-content pre code {
    background: none;
    padding: 0;
}

/* Scrollbar styling */
.input-field::-webkit-scrollbar,
.response-content::-webkit-scrollbar {
    width: 6px;
}

.input-field::-webkit-scrollbar-track,
.response-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.input-field::-webkit-scrollbar-thumb,
.response-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.input-field::-webkit-scrollbar-thumb:hover,
.response-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* PIN Entry Styles */
.pin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f172a 100%);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.4s ease-out;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.pin-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 20px;
    animation: fadeInScale 0.6s ease-out;
}

.pin-input-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.pin-input-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.pin-input {
    width: 100%;
    max-width: 280px;
    padding: 14px 18px;
    font-size: 18px;
    text-align: center;
    letter-spacing: 4px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    outline: none;
    transition: all 0.3s ease;
}

.pin-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.pin-input:focus {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.pin-submit-btn {
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    border: 2px solid rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(99, 102, 241, 0.25));
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pin-submit-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(99, 102, 241, 0.4));
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.pin-submit-btn:active {
    transform: translateY(0);
}

.pin-error {
    color: #ef4444;
    font-size: 14px;
    text-align: center;
    margin-top: -10px;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.setting-item label input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.setting-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    padding: 10px 12px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.setting-select:hover {
    background: rgba(255, 255, 255, 0.15);
}

.setting-select:focus {
    border-color: rgba(59, 130, 246, 0.5);
}

.setting-select option {
    background: #1a1a1a;
    color: #ffffff;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(99, 102, 241, 0.2));
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.5);
    backdrop-filter: blur(10px);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn-primary:hover::before {
    width: 300%;
    height: 300%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(99, 102, 241, 0.35));
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary span {
    position: relative;
    z-index: 1;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* White / Light mode – default */
body[data-theme="light"]::before {
    background: none;
}

body[data-theme="light"] .app-name {
    background: linear-gradient(135deg, #111111 0%, #374151 50%, #6b7280 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body[data-theme="light"] .app-name::after {
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
}

body[data-theme="light"] .input-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .input-container:focus-within {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: #ffffff;
}

body[data-theme="light"] .icon-btn {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #4b5563;
}

body[data-theme="light"] .icon-btn:hover {
    background: #e5e7eb;
    color: #111111;
    border-color: rgba(59, 130, 246, 0.4);
}

body[data-theme="light"] .icon-btn:first-child {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.25);
}

body[data-theme="light"] .input-field {
    color: #111111;
}

body[data-theme="light"] .input-field::placeholder {
    color: #9ca3af;
}

body[data-theme="light"] .send-btn {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.15));
    border-color: rgba(59, 130, 246, 0.35);
    color: #2563eb;
}

body[data-theme="light"] .send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(99, 102, 241, 0.3));
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.6);
}

body[data-theme="light"] .response-content {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .response-content code {
    background: #f3f4f6;
    color: #111111;
}

body[data-theme="light"] .response-content pre {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

body[data-theme="light"] .new-chat-btn {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #4b5563;
}

body[data-theme="light"] .new-chat-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #2563eb;
}

body[data-theme="light"] .copy-btn {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #4b5563;
}

body[data-theme="light"] .copy-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #2563eb;
}

body[data-theme="light"] .copy-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
    color: #16a34a;
}

body[data-theme="light"] .modal-content {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #e5e7eb;
    color: #111111;
}

body[data-theme="light"] .modal-header h2 {
    color: #111111;
}

body[data-theme="light"] .modal-close {
    color: #6b7280;
}

body[data-theme="light"] .modal-close:hover {
    background: #f3f4f6;
    color: #111111;
}

body[data-theme="light"] .setting-select {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #111111;
}

body[data-theme="light"] .setting-select option {
    background: #ffffff;
    color: #111111;
}

body[data-theme="light"] .input-field::-webkit-scrollbar-track,
body[data-theme="light"] .response-content::-webkit-scrollbar-track {
    background: #f3f4f6;
}

body[data-theme="light"] .input-field::-webkit-scrollbar-thumb,
body[data-theme="light"] .response-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
}


/* Light theme: fixed bar background */
body[data-theme="light"] .input-section {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 70%, transparent 100%);
}

/* Responsive / mobile-friendly */
@media (max-width: 768px) {
    .main-content {
        padding: 16px 12px 24px;
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
        gap: 20px;
    }

    .app-name {
        font-size: 32px;
    }

    .input-section {
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .input-container {
        padding: 10px 12px;
        border-radius: 16px;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .send-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .input-field {
        font-size: 16px; /* prevents zoom on focus on iOS */
        min-height: 24px;
    }

    .response-content {
        padding: 16px;
        border-radius: 14px;
    }

    .response-header {
        gap: 8px;
    }

    .new-chat-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .copy-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .modal-content {
        width: 95%;
        max-width: none;
        border-radius: 20px;
        max-height: 85vh;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 12px 10px 20px;
        padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    }

    .app-name {
        font-size: 28px;
    }

    .input-section .input-container {
        padding: 8px 10px;
    }

    .input-icons-left {
        margin-right: 8px;
    }

    .input-icons-right {
        margin-left: 8px;
    }
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
