/* ============================================
   COURSALI AI - Main Stylesheet
   ============================================ */

/* ---------- Reset & Base Styles ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #0072ef;
    --primary-blue-hover: #0056b3;
    --bg-dark: #0a0e1a;
    --bg-container: rgba(15, 19, 29, 0.2);
    --bg-panel: #111d2aa6;
    --bg-panel-light: #181f2f45;
    --text-primary: #1a1a1a;
    --text-secondary: #2d2d2d;
    --text-muted: #4a4a4a;
    --border-color: rgba(0, 0, 0, 0.15);
    --border-blue: rgba(0, 114, 239, 0.2);
    --font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html {
    height: 100%;
}

body {
    font-family: var(--font-family);
    background: #f4f4f4 url('Images/AI/background.jpg') center center / cover no-repeat;
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* ---------- Header Styles ---------- */
.main-header {
    background: rgb(255 255 255 / 20%);
    backdrop-filter: blur(75px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-container {
    max-width: 100%;
    margin: 0;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 41px;
}

.header-logo {
    flex-shrink: 0;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-image {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.header-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 22px;
    margin: 0;
    padding: 0;
    margin-right: 20px;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: color 0.2s ease;
    position: relative;
    opacity: 0.8;
}

.nav-link:hover {
    color: var(--primary-blue);
}

.nav-link.active {
    color: #2e2e2e;
    font-weight: 700;
    opacity: 1;
}

.nav-link.active::after {
    display: none;
}

.nav-link-login {
    /* Removed special styling - now just a regular nav link */
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

/* ---------- Main Content ---------- */
.main-content {
    flex: 1;
    width: 100%;
    height: calc(100vh - 41px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-layout {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 20px;
    padding: 0;
    margin: 0;
}

/* LEFT PANEL - Chat Area */
.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    background: rgb(255 255 255 / 20%);
    backdrop-filter: blur(75px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0;
    overflow: hidden;
    border-radius: 0;
    border-top: solid 1px #2525250a;
    position: relative;
}

/* RIGHT PANEL - Settings Sidebar */

.chat-conversation {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 14px;
    padding: 20px;
    padding-left: 2.5%;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-input-wrapper {
    flex-shrink: 0;
    margin-top: auto;
    padding: 20px;
    padding-bottom: 5%;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.chat-input-container {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #f4f4f478;
    border: 1px solid rgb(0 114 239 / 0%);
    border-radius: 30px;
    gap: 8px;
    width: 95%;
    max-width: 95%;
    margin: 0 auto;
    box-shadow: 0px 0px 15px 5px rgb(0 0 0 / 3%);
}

.chat-input-container textarea {
    flex: 1;
    min-height: 36px;
    max-height: 200px;
    padding: 10px 12px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    line-height: 1.5;
    vertical-align: middle;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.chat-input-container textarea::placeholder {
    color: #4a4a4a;
    opacity: 1;
}

.chat-input-container textarea:focus {
    border: none;
    background: transparent;
    transform: none;
    -webkit-transform: none;
}

.btn-send {
    padding: 8px 20px;
    border: none;
    border-radius: 53px;
    background: #ffffff;
    color: #000000;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 29px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 10px;
}

.btn-send:hover {
    background: #f0f0f0;
    opacity: 0.9;
}

.btn-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.settings-sidebar {
    flex: 0 0 450px;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    padding: 20px 20px 20px 0;
    max-width: 550px;
    margin-left: auto;
}

/* Tabs Container */
.tabs-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: solid 1px #0000000d;
}

.model-info-row {
    background: rgb(255 255 255 / 20%);
    backdrop-filter: blur(75px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid #2525250a;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 19px;
    color: #454545;
    font-size: 16px;
    text-align: left;
    min-height: 22px;
}

.tabs-row {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    min-width: 0;
}

.tab {
    padding: 4px 10px;
    background: linear-gradient(151deg, #f4f4f45c 0%, #f4f4f41c 100%);
    border: 0px solid rgb(0 114 239 / 0%);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 10px;
    color: #272727;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 22px;
    font-weight: 400;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.tab:hover {
    background: linear-gradient(151deg, #f4f4f45c 0%, #f4f4f41c 100%);
    opacity: 0.8;
}

.tab.active {
    background: linear-gradient(151deg, #f4f4f45c 0%, #f4f4f41c 100%);
    color: #272727;
    font-weight: 700;
    border: 1px solid #2e2e2e;
}

.tab-label {
    display: inline-block;
    user-select: none;
}

.tab input.tab-rename-input {
    background: transparent;
    border: 1px solid #2e2e2e;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 10px;
    color: inherit;
    width: 100%;
    min-width: 50px;
    outline: none;
    font-family: inherit;
}

.tab-add-btn,
.tab-delete-btn {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    background: linear-gradient(151deg, #f4f4f45c 0%, #f4f4f41c 100%);
    border: 0px solid rgb(0 114 239 / 0%);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #272727;
    font-size: 14px;
    font-weight: 300;
}

.tab-add-btn:hover,
.tab-delete-btn:hover {
    background: linear-gradient(151deg, #f4f4f45c 0%, #f4f4f41c 100%);
    opacity: 0.8;
}

.tab-add-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tab-delete-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.setting-box {
    background: rgb(255 255 255 / 20%);
    backdrop-filter: blur(75px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid #2525250a;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 19px;
    position: relative;
    z-index: 1;
}

.setting-box.dropdown-open {
    z-index: 1000;
}

.setting-box:last-child {
    margin-bottom: 0;
}

.setting-box-header {
    color: #2e2e2e;
    font-size: 13px;
    font-weight: 400;
    margin: 0 0 12px 0;
    padding: 0;
    border-bottom: solid 1px #0000000d;
    padding-bottom: 6px;
}

.setting-box-header.expandable-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.setting-box-header.expandable-header:hover {
    opacity: 0.8;
}

.expand-icon {
    font-size: 20px;
    color: #0a0a0a2e;
    transition: transform 0.2s ease;
    display: inline-block;
    margin-left: 4px;
    line-height: 1;
}

.expand-icon::before {
    content: "›";
    display: inline-block;
    transform: rotate(90deg);
}

.expandable-box.expanded .expand-icon {
    transform: rotate(180deg);
}

.expandable-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

/* ---------- Footer ---------- */
.main-footer {
    background: rgb(255 255 255 / 0%);
    backdrop-filter: blur(75px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 5px;
    margin-top: auto;
    flex-shrink: 0;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    color: #0000003d;
    font-size: 11px;
}

/* ---------- COURSALI AI Container ---------- */
#coursali-box {
    max-width: 100%;
    margin: 0 auto;
    font-family: var(--font-family);
}

#coursali-container {
    background: var(--bg-container);
    backdrop-filter: blur(6.9px);
    -webkit-backdrop-filter: blur(6.9px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.coursali-header {
    margin-bottom: 16px;
}

.coursali-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.coursali-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.coursali-title-bold {
    font-weight: 700;
    color: var(--text-primary);
}

.coursali-status {
    display: none;
    font-size: 10px;
    background: rgba(0, 114, 239, 0.25);
    color: #8fb9ff;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid rgba(0, 114, 239, 0.4);
}

.coursali-description {
    margin: 0;
    color: white;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    opacity: 0.85;
    padding-left: 5px;
    padding-right: 5px;
}

/* ---------- Layout ---------- */
.c-grid {
    display: flex;
    gap: 18px;
}

.c-left {
    flex: 1 1 auto;
    min-width: 0;
}

.c-right {
    flex: 0 0 320px;
}

.desktop-only {
    display: block !important;
}

.mobile-only {
    display: none !important;
}

.sticky {
    position: sticky;
    top: 12px;
}

/* Panels */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-blue);
    border-radius: 10px;
    padding: 12px;
}

.panel.slim {
    padding: 10px;
    background-color: var(--bg-panel-light) !important;
    margin-top: -5px !important;
    margin-bottom: 15px !important;
}

.panel.slim:focus-within {
    background-color: var(--bg-panel-light) !important;
}

/* Conversation - now handled by .chat-conversation */
#c-out {
    /* Styles are now in .chat-conversation */
}

.history {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.placeholder-text {
    color: var(--text-muted);
    font-size: 12px;
    opacity: 0.7;
}

/* Mobile tabs container */
.mobile-tabs-container {
    display: none;
    padding: 12px 15px 8px 15px;
    background: transparent;
}

.mobile-tabs-container .tabs-container {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 90%;
}

.message-wrapper.user {
    align-self: flex-end;
    align-items: flex-end;
    margin-right: 0.5%;
}

.message-wrapper.ai {
    align-self: flex-start;
    align-items: flex-start;
}

.bubble {
    padding: 8px 14px;
    border-radius: 20px;
    white-space: pre-wrap;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.bubble.user {
    text-align: right;
    background: rgb(0 114 239);
    border: none;
    color: white;
    font-size: 13px;
    max-width: fit-content;
}

.bubble.ai {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #1a1a1a;
    font-size: 13px;
}

.bubble.err {
    background: rgba(120, 32, 32, 0.45);
    color: #ffd6d6;
}

/* Message header */
.msg-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 9px;
    opacity: 1;
    padding: 0;
    border-radius: 0;
    width: fit-content;
    box-shadow: none !important;
    background: transparent !important;
    border: none !important;
    color: #666666;
}

.message-wrapper.user .msg-header {
    justify-content: flex-end;
    margin-left: auto;
}

.message-wrapper.ai .msg-header {
    justify-content: flex-start;
}

.msg-label {
    font-weight: 600;
}

.msg-time {
    opacity: 0.6;
}

.bubble > div:last-child {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

/* Textarea - now handled by .chat-input-container textarea */
#c-in {
    /* Styles are now in .chat-input-container textarea */
}

/* Actions row */
.actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

/* Drop images */
.drop-panel {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 33px;
    padding: 0 16px;
    border: 1px dashed rgb(0 0 0 / 17%);
    border-radius: 30px;
    background-color: #00000017;
    color: #4a4a4a;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

/* Override for mobile drop panel - base rule */
.mobile-input-actions .drop-panel,
.mobile-input-actions .drop-panel.mobile-drop-panel {
    flex: 0 0 50% !important;
    width: 50% !important;
    max-width: 50% !important;
    box-sizing: border-box;
}

.drop-panel:hover {
    background: rgb(255 255 255 / 5%);
    border-color: rgb(0 0 0 / 20%);
}

.desktop-drop-wrapper {
    width: 95%;
    max-width: 95%;
    margin: 0 auto;
    display: block;
    text-align: center;
}

.desktop-drop-wrapper .drop-panel {
    width: 30%;
    max-width: 30%;
    margin: 0 auto;
    display: inline-flex;
    justify-content: center;
}

.mobile-input-actions {
    display: none !important;
}

.mobile-drop-panel {
    /* Base styles - will be overridden in mobile media query */
}

.mobile-settings-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 13px;
    height: 36px;
    white-space: nowrap;
}

.thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0;
}

.thumbs img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(0, 114, 239, 0.4);
    background: rgba(0, 0, 0, 0.35);
}

/* Buttons */
.btn-primary {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    background: var(--primary-blue);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 250px;
}

.btn-primary:hover {
    background: var(--primary-blue-hover);
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    height: 40px;
    text-decoration: underline;
    font-size: 12px;
    white-space: nowrap;
}

.desktop-clear {
    display: none;
}

.mobile-clear {
    display: none;
    width: 100%;
    height: 33px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid var(--border-blue);
    border-radius: 10px;
    background: #111d2a45;
    color: white;
    font-size: 13.2px;
    cursor: pointer;
    font-weight: 400;
    text-decoration: none;
    margin-top: 10px;
}

/* Mobile Advanced Settings */
.mobile-adv {
    background: transparent;
    border: none;
    margin-top: 10px;
}

.adv-summary {
    width: 94%;
    height: 33px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--border-blue);
    border-radius: 10px;
    background: #111d2ab3;
    color: var(--text-primary);
    font-size: 13.2px;
    cursor: pointer;
    list-style: none;
    font-weight: 400;
    margin-top: -3px;
}

.adv-summary::-webkit-details-marker {
    display: none;
}

.adv-summary::marker {
    display: none;
}

.adv-summary::before {
    content: "";
    display: none;
}

/* Mobile Type Dropdown */
.mobile-type-dropdown {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

.mobile-type-btn {
    width: 93%;
    height: 23px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--border-blue);
    border-radius: 10px;
    background: var(--bg-panel);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.mobile-type-menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 6px;
    border: none;
    border-radius: 10px;
    background: #111d2a;
    z-index: 1000;
    overflow: hidden;
    box-shadow: none;
}

.mobile-type-opt {
    padding: 10px 12px;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    background: #111d2a;
    transition: background 0.15s;
}

.mobile-type-opt:hover {
    background: rgba(0, 114, 239, 0.2);
}

/* Mobile Tone Dropdown */
.mobile-tone-dropdown {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

.mobile-tone-btn {
    width: 93%;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--border-blue);
    border-radius: 10px;
    background: var(--bg-panel);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.mobile-tone-menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 6px;
    border: none;
    border-radius: 10px;
    background: #111d2a;
    z-index: 1000;
    overflow: hidden;
    box-shadow: none;
}

.mobile-tone-opt {
    padding: 10px 12px;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    background: #111d2a;
    transition: background 0.15s;
}

.mobile-tone-opt:hover {
    background: rgba(0, 114, 239, 0.2);
}

/* Mobile References */
.mobile-refs {
    display: block;
    width: 100%;
}

.mobile-refs-label {
    display: block;
    color: var(--text-primary);
    font-size: 12px;
    margin-bottom: 6px;
}

.mobile-refs textarea {
    width: 93%;
    min-height: 60px;
    background: #2c3e503d;
    border: 1px solid var(--border-blue);
    border-radius: 10px;
    padding: 10px;
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    outline: none;
}

.mobile-refs textarea:focus {
    background: #2c3e503d !important;
}

.mobile-refs textarea:-webkit-autofill,
.mobile-refs textarea:-webkit-autofill:hover,
.mobile-refs textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary) !important;
    -webkit-box-shadow: 0 0 0px 1000px #2c3e503d inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Mobile Product Context */
.mobile-product-context {
    display: block;
    width: 100%;
}

.mobile-product-context-label {
    display: block;
    color: var(--text-primary);
    font-size: 12px;
    margin-bottom: 6px;
}

.mobile-product-context textarea {
    width: 93%;
    min-height: 60px;
    background: #2c3e503d;
    border: 1px solid var(--border-blue);
    border-radius: 10px;
    padding: 10px;
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    outline: none;
}

.mobile-product-context textarea:focus {
    background: #2c3e503d !important;
}

.mobile-product-context textarea:-webkit-autofill,
.mobile-product-context textarea:-webkit-autofill:hover,
.mobile-product-context textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary) !important;
    -webkit-box-shadow: 0 0 0px 1000px #2c3e503d inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Settings Heading */
.settings-heading {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Desktop Type Buttons */
.desktop-type-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.setting-box .desktop-type-buttons {
    margin: 0;
}

.desktop-type-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: calc(50% - 4px);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 0px solid rgb(0 114 239 / 0%);
    border-radius: 10px;
    background: linear-gradient(151deg, #f4f4f45c 0%, #f4f4f41c 100%);
    color: #272727;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.desktop-type-btn:hover {
    background: linear-gradient(151deg, #f4f4f45c 0%, #f4f4f41c 100%);
}

.desktop-type-btn.selected {
    background: #2e2e2e;
    color: #ffffff;
}

/* Desktop Tone Buttons */
.desktop-tone-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.setting-box .desktop-tone-buttons {
    margin: 0;
}

.desktop-tone-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: calc(50% - 4px);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 0px solid rgb(0 114 239 / 0%);
    border-radius: 10px;
    background: linear-gradient(151deg, #f4f4f45c 0%, #f4f4f41c 100%);
    color: #272727;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.desktop-tone-btn:nth-child(3) {
    flex: 0 0 calc(50% - 4px);
    width: calc(50% - 4px);
}

.desktop-tone-btn:hover {
    background: linear-gradient(151deg, #f4f4f45c 0%, #f4f4f41c 100%);
}

.desktop-tone-btn.selected {
    background: #2e2e2e;
    color: #ffffff;
}

/* Desktop References */
.desktop-refs {
    display: block;
    width: 100%;
}

.setting-box .desktop-refs {
    margin: 0;
}

.desktop-refs-label {
    display: block;
    color: white;
    font-size: 12px;
    margin-bottom: 6px;
}

.desktop-refs textarea {
    width: 100%;
    min-height: 100px;
    background: #f4f4f440;
    border: 1px solid rgb(0 114 239 / 0%);
    border-radius: 10px;
    padding: 10px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: all 0.2s ease;
}

.desktop-refs textarea::placeholder {
    color: #4a4a4a;
    opacity: 1;
}

.desktop-refs textarea:focus {
    border: 1px solid #2e2e2e;
    background: #f4f4f440;
}

/* Desktop Product Context */
.desktop-product-context {
    display: block;
    width: 100%;
}

.setting-box .desktop-product-context {
    margin: 0;
}

.desktop-product-context-label {
    display: block;
    color: white;
    font-size: 12px;
    margin-bottom: 6px;
}

.desktop-product-context textarea {
    width: 100%;
    min-height: 100px;
    background: #f4f4f440;
    border: 1px solid rgb(0 114 239 / 0%);
    border-radius: 10px;
    padding: 10px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: all 0.2s ease;
}

.desktop-product-context textarea::placeholder {
    color: #4a4a4a;
    opacity: 1;
}

.desktop-product-context textarea:focus {
    border: 1px solid #2e2e2e;
    background: #f4f4f440;
}

/* Desktop right panel */
.c-right .panel {
    display: flex;
    flex-direction: column;
    background-color: #121b2433;
    border: solid 1px #242b3a78;
}

/* Desktop actions row */
@media (min-width: 768px) {
    .nav-link {
        font-size: 12px;
        color: #2e2e2e;
        opacity: 1;
    }

    .nav-link.active {
        color: #2e2e2e;
        font-weight: 700;
    }

    .drop-panel {
        flex: 0 0 auto;
        padding: 0 26px;
        min-width: 350px;
        height: 40px;
        min-height: 40px;
    }

    .actions-row {
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .btn-link {
        flex-shrink: 0;
    }

    .desktop-clear {
        display: flex;
        justify-content: center;
        align-items: center;
        text-decoration: none;
        background: #0a13214d;
        height: 30px;
        border-radius: 10px;
        color: white;
        font-size: 10px;
    }

    .btn-primary {
        margin-left: 0;
    }

    .mobile-clear {
        display: none !important;
    }

    .actions-row .btn-link {
        display: flex;
    }
}

/* Responsive */
@media (max-width: 900px) {
    .c-right {
        flex: 0 0 280px;
    }
}

/* Mobile Styles */
@media (max-width: 767px) {
    /* Header Mobile */
    .header-container {
        padding: 0 15px;
        height: 41px;
    }

    .nav-list {
        position: fixed;
        top: 41px;
        left: 0;
        right: 0;
        width: 100%;
        background: #ffffff;
        backdrop-filter: none;
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-list.active {
        transform: translateX(0);
    }

    .nav-link {
        color: #2e2e2e;
        opacity: 1;
    }

    .nav-link.active {
        color: #2e2e2e;
        font-weight: 700;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .main-content {
        height: calc(100vh - 41px);
        padding: 0;
    }

    .chat-layout {
        flex-direction: column;
        padding: 0;
        gap: 0;
        height: 100%;
    }

    .left-panel {
        padding: 0;
        border-radius: 0;
    }

    .mobile-tabs-container {
        display: block !important;
        background: #0000000d !important;
    }

    .mobile-placeholder-text {
        display: block !important;
    }

    .mobile-tabs-container .tab {
        background: linear-gradient(151deg, #f4f4f4c2 0%, #f4f4f494 100%) !important;
        font-weight: 400 !important;
    }

    .mobile-tabs-container .tab.active {
        background: linear-gradient(151deg, #f4f4f4c2 0%, #f4f4f494 100%) !important;
        color: #272727 !important;
        font-weight: 700 !important;
        border: 1px solid #2e2e2e !important;
    }

    .chat-conversation {
        flex: 1;
        min-height: 250px;
        padding: 15px;
        padding-top: 8px;
        font-size: 13px;
        margin: 0;
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }

    .placeholder-text {
        color: #4a4a4a !important;
        opacity: 1 !important;
        padding-top: 8px;
    }

    .chat-input-wrapper {
        flex-shrink: 0;
        margin-top: auto;
        padding: 15px 10px;
        padding-top: 50px;
        padding-bottom: 1px;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .mobile-input-actions {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        align-items: center !important;
        width: 95%;
        max-width: 95%;
        margin: 0 auto;
        margin-bottom: 5% !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
    }

    .mobile-input-actions .drop-panel {
        flex: 0 0 50% !important;
        min-width: 0 !important;
        min-height: 31px !important;
        height: 31px !important;
        font-size: 12px;
        padding: 0 12px;
        width: 50% !important;
        max-width: 50% !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        flex-shrink: 0;
        background-color: #00000017 !important;
    }

    .mobile-input-actions .mobile-settings-btn,
    .mobile-input-actions .btn-send.mobile-settings-btn {
        flex: 0 0 auto !important;
        padding: 8px 16px !important;
        font-size: 10px !important;
        height: 31px !important;
        min-height: 31px !important;
        white-space: nowrap !important;
        width: auto !important;
        flex-shrink: 0 !important;
        display: block !important;
        margin: 0 !important;
        order: 2 !important;
        background: #2e2e2e !important;
        color: white !important;
    }

    .mobile-input-actions .drop-panel {
        order: 1 !important;
    }

    .chat-input-container {
        padding: 5px 0px 5px 15px;
        gap: 0px;
        width: 100%;
        max-width: 100%;
        border-radius: 30px;
        align-items: center;
        touch-action: manipulation;
    }

    .chat-input-container textarea,
    #c-in {
        font-size: 16px !important;
        padding: 9px 4px 9px 4px;
        min-height: 36px;
        max-height: 36px;
        line-height: 1.2;
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        max-width: none;
        box-sizing: border-box;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        -webkit-text-size-adjust: 100%;
        zoom: 0.875;
    }

    .chat-input-container .btn-send {
        flex-shrink: 0;
        flex-grow: 0;
        padding: 8px 12px;
        width: auto;
        min-width: auto;
    }

    .chat-input-container textarea::placeholder {
        font-size: 14px;
        line-height: 1.4;
        color: transparent;
    }
    
    .chat-input-container textarea:focus,
    .chat-input-container textarea:active {
        font-size: 16px !important;
        -webkit-text-size-adjust: 100% !important;
        zoom: 0.875;
    }

    .mobile-placeholder-text {
        display: none;
        color: #0000008a;
        font-size: 12px;
        padding: 0 15px 0px 15px;
        margin-bottom: -5px;
        opacity: 1;
        text-align: center;
        line-height: 1.4;
        font-style: italic;
    }

    .btn-send {
        padding: 8px 16px;
        font-size: 11px;
        height: 36px;
    }

    .settings-sidebar {
        position: fixed !important;
        top: 41px;
        right: -100%;
        width: 100%;
        max-width: 100%;
        height: calc(100vh - 41px);
        background: rgb(255 255 255 / 20%);
        backdrop-filter: blur(75px);
        -webkit-backdrop-filter: blur(75px);
        z-index: 2000;
        padding: 20px;
        padding-top: 50px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        overflow-y: auto;
        display: flex !important;
        flex-direction: column;
    }

    .settings-sidebar .tabs-container {
        display: none !important;
    }

    .settings-sidebar .desktop-type-btn,
    .settings-sidebar .desktop-tone-btn {
        background: linear-gradient(151deg, #2e2e2e1a 0%, #1b19190d 100%) !important;
    }

    .settings-sidebar .desktop-product-context textarea,
    .settings-sidebar .desktop-refs textarea {
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
    }

    .settings-sidebar.mobile-open {
        right: 0;
    }

    .model-info-row.mobile-only {
        font-size: 14px;
        padding: 12px;
        margin-bottom: 15px;
    }

    .mobile-exit-settings {
        text-align: center;
        color: #2e2e2e;
        font-size: 12px;
        padding: 15px 0;
        margin-top: 10px;
        cursor: pointer;
        opacity: 0.7;
        transition: opacity 0.2s ease;
    }

    .mobile-exit-settings:hover {
        opacity: 1;
    }

    .mobile-settings-overlay {
        display: none !important;
    }

    .mobile-settings-overlay.active {
        display: none !important;
    }

    .mobile-settings-close.mobile-only {
        position: fixed !important;
        top: 50px !important;
        right: 20px !important;
        width: 32px;
        height: 32px;
        z-index: 2001 !important;
        padding: 0;
        background: transparent;
        border: none;
        font-size: 28px;
        color: #2e2e2e;
        cursor: pointer;
        display: none !important;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    .mobile-settings-close.mobile-only.show {
        display: flex !important;
    }

    .mobile-settings-close:hover {
        opacity: 0.7;
    }

    .desktop-only {
        display: none !important;
    }

    .desktop-only.settings-sidebar.mobile-open {
        display: flex !important;
    }

    .mobile-only {
        display: block !important;
    }

    .mobile-input-actions.mobile-only {
        display: flex !important;
        flex-direction: row !important;
    }

    .bubble {
        padding: 12px 12px;
        font-size: 12px;
        max-width: 85%;
    }

    .message-wrapper {
        max-width: 85%;
    }

    .msg-header {
        font-size: 10px;
        margin-bottom: 4px;
        gap: 6px;
    }

    .history {
        gap: 10px;
    }

    .panel {
        padding: 14px 10px;
    }

    .panel.slim {
        padding: 8px;
        margin-top: -5px !important;
        margin-bottom: 12px !important;
    }

    #c-in {
        font-size: 16px !important;
        min-height: 45px;
        transform: scale(0.75);
        transform-origin: left;
        width: 133.33%;
        padding: 12px 0px 0px 4px;
        -webkit-text-size-adjust: 100%;
        zoom: 0.875;
    }

    #c-in:focus {
        background: transparent !important;
        transform: scale(0.75) !important;
        -webkit-transform: scale(0.75) !important;
        font-size: 16px !important;
        -webkit-text-size-adjust: 100% !important;
        zoom: 0.875;
    }

    .mobile-refs textarea {
        font-size: 16px !important;
        transform: scale(0.75);
        transform-origin: left;
        width: 127.00%;
    }

    .mobile-refs textarea:focus {
        background: #2c3e503d !important;
    }

    .mobile-product-context textarea {
        font-size: 16px !important;
        transform: scale(0.75);
        transform-origin: left;
        width: 127.00%;
    }

    .mobile-product-context textarea:focus {
        background: #2c3e503d !important;
    }

    .btn-primary {
        font-size: 12px;
        padding: 8px 20px;
        height: 36px;
    }

    .drop-panel {
        font-size: 12px;
        padding: 0 14px;
        min-height: 36px;
    }

    .mobile-input-actions .drop-panel {
        flex: 0 0 50% !important;
        width: 50% !important;
        max-width: 50% !important;
        min-width: 0 !important;
    }

    .adv-summary {
        font-size: 12px;
        height: 30px;
        padding: 6px 10px;
    }

    .mobile-clear {
        font-size: 12px;
        height: 30px;
        padding: 6px 10px;
    }

    .mobile-type-btn,
    .mobile-tone-btn {
        font-size: 11px;
        height: 22px;
        padding: 6px 10px;
    }

    .mobile-refs-label,
    .mobile-product-context-label {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .mobile-refs textarea,
    .mobile-product-context textarea {
        padding: 8px;
        min-height: 55px;
    }

    .coursali-title {
        font-size: 18px !important;
    }

    .coursali-description {
        font-size: 12px !important;
        padding-left: 3px !important;
        padding-right: 3px !important;
    }

    /* Mobile actions row */
    .actions-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .btn-primary {
        margin-left: 0;
        width: 100%;
        order: 1;
        min-width: auto;
    }

    .drop-panel {
        width: 100%;
        order: 2;
        padding: 5px 12px;
    }

    .actions-row .btn-link {
        display: none;
    }
}