﻿@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@500;600;700;800&family=Source+Sans+3:wght@400;500;600;700&display=swap');

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

html,
body {
  height: 100%;
  font-family: 'Source Sans 3', sans-serif;
}

html {
  scroll-behavior: smooth;
}

:root {
  --bg: #ece7dd;
  --bg-alt: #e4ddd1;
  --surface: #f9f6ef;
  --surface-strong: #ffffff;
  --surface-muted: #f1ece2;
  --surface-floating: rgba(255, 255, 255, 0.9);

  --text-color: #1a2129;
  --muted-text: #5a6472;
  --border-color: #d2c9ba;

  --shadow-lg: 0 20px 44px rgba(18, 26, 35, 0.14);
  --shadow-md: 0 10px 24px rgba(18, 26, 35, 0.1);
  --shadow-sm: 0 4px 12px rgba(18, 26, 35, 0.08);

  --container-bg-color: rgba(249, 246, 239, 0.94);
  --sidebar-background-color: rgba(245, 241, 233, 0.95);

  --user-bg-color: #deefe7;
  --assistant-bg-color: #edf2f7;

  --toggle-bg-color: #c7d2df;
  --toggle-hover-color: #afbfce;
  --menu-surface-color: #f6f2e9;
  --apps-panel-bg: #faf7f1;
  --apps-sheet-bg: #faf7f1;

  --input-text-color: #1d2732;
  --input-background-color: #ffffff;
  --input-border-color: #c9bec8;
  --input-focus-border-color: #0f7665;

  --accent: #0f7665;
  --accent-hover: #0b5f52;
  --accent-strong: #0a5044;
  --accent-ink: #ffffff;
  --accent-soft: #d8ede8;

  --secondary-accent: #1b5678;
  --secondary-soft: #dfe8ee;

  --btn-primary-color: #0f7665;
  --btn-primary-hover-color: #0b5f52;
  --btn-secondary-color: #c5523f;
  --btn-secondary-hover-color: #ac4534;

  --highlighted-code-bg-color: #f3efe5;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
}

body.night-mode {
  --bg: #11161d;
  --bg-alt: #171f29;
  --surface: #1a232d;
  --surface-strong: #202a36;
  --surface-muted: #18212b;
  --surface-floating: rgba(28, 38, 49, 0.92);

  --text-color: #e8eff8;
  --muted-text: #a3b1c0;
  --border-color: #314153;

  --shadow-lg: 0 24px 46px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 12px 26px rgba(0, 0, 0, 0.34);
  --shadow-sm: 0 5px 14px rgba(0, 0, 0, 0.28);

  --container-bg-color: rgba(22, 31, 40, 0.94);
  --sidebar-background-color: rgba(20, 28, 36, 0.95);

  --user-bg-color: #204d44;
  --assistant-bg-color: #243747;

  --toggle-bg-color: #30465d;
  --toggle-hover-color: #3b5672;
  --menu-surface-color: #1b2733;
  --apps-panel-bg: #1a2733;
  --apps-sheet-bg: #1a2733;

  --input-text-color: #eef3fb;
  --input-background-color: #131c25;
  --input-border-color: #385066;
  --input-focus-border-color: #38b89f;

  --accent: #2ca896;
  --accent-hover: #229383;
  --accent-strong: #1a7f71;
  --accent-ink: #ffffff;
  --accent-soft: #1b4f46;

  --secondary-accent: #6ca4c7;
  --secondary-soft: #243748;

  --btn-primary-color: #2ca896;
  --btn-primary-hover-color: #229383;
  --btn-secondary-color: #d26f5f;
  --btn-secondary-hover-color: #be5d4f;

  --highlighted-code-bg-color: #1b2a37;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0;
  }

  40% {
    opacity: 1;
  }
}

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text-color);
  transition: background-color 0.35s ease, color 0.35s ease;
  overflow: hidden;
}

#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  z-index: -1;
}

.container {
  display: flex;
  height: 100%;
  width: 100vw;
  gap: 14px;
  padding: 14px;
  overflow: hidden;
}

.menu-icon {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1100;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--surface-floating);
  color: var(--text-color);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  display: none;
  align-items: center;
  justify-content: center;
}

.menu-icon:hover {
  transform: translateY(-1px);
}

.sidebar {
  flex: 0 0 304px;
  min-width: 304px;
  max-width: 304px;
  background: var(--sidebar-background-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px;
  position: sticky;
  top: 0;
  z-index: 4;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.brand-logo img {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.brand-text .brand-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-color);
}

.brand-text .brand-subtitle {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-text);
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar li {
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-color);
}

.model-picker {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.dropdown {
  position: relative;
  width: 100%;
}

.dropdown button {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text-color);
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.dropdown button:hover {
  background: var(--surface-strong);
  border-color: var(--accent);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 270px;
  max-height: min(62vh, 520px);
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--menu-surface-color);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
}

.dropdown-content div {
  padding: 11px 14px;
  color: var(--text-color);
}

.dropdown-content div:hover {
  background: var(--accent-soft);
}

#new-chat {
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--btn-primary-color);
  color: var(--accent-ink);
  padding: 11px 15px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

#new-chat:hover {
  background: var(--btn-primary-hover-color);
}

#new-chat:active {
  transform: translateY(1px);
}

#session-list {
  max-height: 260px;
  overflow-y: auto;
  margin: 12px 0;
  padding: 0;
}

#session-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 7px;
  background: var(--surface);
  cursor: pointer;
}

#session-list li:hover {
  border-color: var(--accent);
}

#session-list li button {
  border: 0;
  background: transparent;
  color: var(--btn-secondary-color) !important;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}

#session-list + #remaining-tokens {
  margin-bottom: 10px;
}

.sidebar-promos {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-promo-link {
  text-decoration: none !important;
}

.sidebar-promo-row {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--surface);
  padding: 9px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.sidebar-promo-row:hover {
  border-color: var(--accent);
  background: var(--surface-strong);
}

.sidebar-promo-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-color);
}

#remaining-tokens {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-text);
}

.chatGPT-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--container-bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  padding: 10px;
}

.header-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1002;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-floating);
  box-shadow: var(--shadow-md);
  max-width: calc(100% - 20px);
}

.header-controls > * {
  display: flex;
  align-items: center;
}

.theme-switcher {
  position: relative;
}

.theme-switcher input[type='checkbox'] {
  display: none;
}

.slider {
  position: relative;
  width: 58px;
  height: 30px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  background: var(--toggle-bg-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  transition: background-color 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}

.slider::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.28s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  z-index: 1;
}

.theme-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #506275;
  opacity: 0.6;
  transition: color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 2;
}

.theme-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-moon svg {
  fill: currentColor;
  stroke: none;
}

.theme-icon-sun {
  opacity: 1;
  color: #b8860b;
}

.theme-icon-moon {
  opacity: 0.45;
  color: #111111;
}

input[type='checkbox']:checked + .slider {
  background: #2f4254;
  border-color: #425a71;
}

input[type='checkbox']:checked + .slider::before {
  transform: translateX(28px);
}

input[type='checkbox']:checked + .slider .theme-icon-sun {
  opacity: 0.45;
  color: #b8860b;
}

input[type='checkbox']:checked + .slider .theme-icon-moon {
  opacity: 1;
  color: #111111;
}

.language-dropdown {
  position: relative;
  z-index: 1002;
}

.language-button {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text-color);
  font-size: 18px;
  font-weight: 700;
  padding: 4px 8px;
  cursor: pointer;
}

.language-button:hover {
  border-color: var(--accent);
}

.language-dropdown .dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--menu-surface-color);
  box-shadow: var(--shadow-lg);
  padding: 4px 0;
}

.language-dropdown.active .dropdown-content {
  display: block;
}

.language-dropdown .dropdown-content a {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 12px;
  color: var(--text-color);
  text-decoration: none;
}

.language-dropdown .dropdown-content a:hover {
  background: var(--accent-soft);
}

.red {
  color: #d93838;
}

.yellow {
  color: #b88b00;
}

.orange {
  color: #d7692b;
}

.black {
  color: #111111;
}

.white {
  color: #ffffff;
}

.blue {
  color: #2464c8;
}

.green {
  color: #1f8e57;
}

.dropdown-content a span {
  font-weight: 700;
}

.apps-dock-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  z-index: 1003;
}

.apps-tabs {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  box-shadow: var(--shadow-sm);
  width: max-content;
  max-width: none;
  overflow: hidden;
}

.apps-tab {
  appearance: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--text-color);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
}

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

.apps-tab[aria-selected='true'] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.apps-launcher {
  display: none;
  appearance: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--text-color);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.apps-launcher:hover {
  border-color: var(--accent);
}

.apps-shell-collapsed .apps-launcher {
  display: inline-flex;
}

.apps-shell-collapsed:not(.apps-shell-temp-expanded) .apps-tabs {
  display: none;
}

.apps-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(980px, calc(100vw - 20px));
  max-height: min(64vh, 560px);
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--apps-panel-bg);
  box-shadow: var(--shadow-lg);
  padding: 14px;
}

.apps-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.apps-panel-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-color);
}

.apps-panel-subtitle {
  font-size: 12px;
  color: var(--muted-text);
}

.apps-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.apps-standalone-row {
  margin-top: 12px;
}

.apps-standalone-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.apps-standalone-row .apps-card {
  width: 100%;
}

.apps-group-block {
  margin-top: 7px;
}

.apps-group-label {
  margin: 10px 0 8px;
  color: var(--muted-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.apps-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-color);
  text-decoration: none;
  padding: 11px;
  box-shadow: var(--shadow-sm);
}

.apps-card.featured {
  border-color: var(--accent);
  background: var(--surface-strong);
}

.apps-card:hover {
  border-color: var(--accent);
}

.apps-card-main-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.apps-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.apps-card-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.apps-card-flag {
  width: 20px;
  height: 14px;
  border-radius: 3px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.apps-card-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.apps-card-open {
  color: var(--muted-text);
  font-size: 11px;
}

.apps-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.apps-badge,
.apps-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.apps-badge {
  background: var(--accent-soft);
}

.apps-chip {
  background: var(--surface-muted);
}

.apps-submenu-toggle {
  appearance: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--text-color);
  padding: 4px 10px;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
}

.apps-submenu-toggle:hover {
  border-color: var(--accent);
}

.apps-card-submenu {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.apps-card-submenu[hidden] {
  display: none !important;
}

.apps-card-submenu-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--text-color);
  text-decoration: none;
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.2;
}

.apps-card-submenu-link:hover {
  border-color: var(--accent);
}

.apps-sheet {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.apps-sheet[hidden] {
  display: none !important;
}

.apps-sheet-backdrop {
  appearance: none;
  border: 0;
  padding: 0;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.apps-sheet-body {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: 72vh;
  border: 1px solid var(--border-color);
  border-bottom: 0;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  background: var(--apps-sheet-bg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  padding: 12px;
}

.apps-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.apps-sheet-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.apps-sheet-close {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text-color);
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.apps-sheet-content {
  max-height: calc(72vh - 56px);
  overflow: auto;
  padding-right: 2px;
}

body.apps-sheet-open {
  overflow: hidden;
}

.apps-sheet-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 1px 8px;
  margin-bottom: 6px;
}

.apps-sheet-tab {
  appearance: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--text-color);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.apps-sheet-tab.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

#other-models-menu .apps-sidebar-heading {
  padding: 10px 16px 4px;
  font-size: 11px;
  color: var(--muted-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#other-models-menu .apps-sidebar-divider {
  height: 1px;
  margin: 5px 8px;
  background: var(--border-color);
}

.messages {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 84px 16px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  scroll-behavior: smooth;
}

.user,
.assistant {
  position: relative;
  max-width: min(94%, 980px);
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease;
}

.user {
  align-self: flex-end;
  background: var(--user-bg-color);
  border-bottom-right-radius: 8px;
  margin-top: 14px;
}

.assistant {
  align-self: flex-start;
  background: var(--assistant-bg-color);
  border-bottom-left-radius: 8px;
}

.assistant.loading {
  min-height: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 16px;
}

.assistant.loading .message-content {
  display: flex;
  align-items: center;
  padding: 0;
  width: auto;
}

.message-container {
  position: relative;
  border-radius: 12px;
  padding-bottom: 32px;
}

.message-actions {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.message-container:hover .message-actions,
.message-container:focus-within .message-actions {
  opacity: 1;
  transform: translateY(0);
}

.play-btn,
.stop-btn,
.copy-btn {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text-color);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.play-btn:hover,
.stop-btn:hover,
.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.typing-indicator {
  display: flex;
  align-items: center;
}

.typing-indicator .dot {
  width: 8px;
  height: 8px;
  margin: 0 2px;
  border-radius: 50%;
  background: #6a7786;
  animation: blink 1.4s infinite both;
}

.typing-indicator .dot:nth-child(1) {
  animation-delay: 0s;
}

.typing-indicator .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator .dot:nth-child(3) {
  animation-delay: 0.4s;
}

.highlighted-code-container {
  position: relative;
  display: block;
  margin: 10px 0;
  padding: 10px 8px 10px 10px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--highlighted-code-bg-color);
}

.highlighted-code {
  display: block;
  word-wrap: break-word;
  color: var(--text-color);
  font-family: 'Courier New', monospace;
}

.copy-button {
  position: absolute;
  top: 6px;
  right: 6px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--text-color);
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
}

.input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--border-color);
  background: var(--surface-floating);
}

#user-input {
  flex-grow: 1;
  min-height: 50px;
  max-height: 180px;
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid var(--input-border-color) !important;
  background: var(--input-background-color) !important;
  color: var(--input-text-color) !important;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#user-input:focus {
  border-color: var(--input-focus-border-color) !important;
  box-shadow: 0 0 0 4px rgba(15, 118, 101, 0.2);
}

#user-input[contenteditable='true']:empty:before {
  content: attr(data-placeholder);
  pointer-events: none;
  display: block;
  color: #7a848f;
}

.attach-btn,
.send-btn {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.attach-btn {
  background: var(--surface-strong);
  color: var(--text-color);
}

.attach-btn:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.send-btn {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.send-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.GPT-chatly-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, 82%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--surface-floating);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  text-align: center;
  color: var(--text-color);
  font-size: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.GPT-chatly-message h1,
.GPT-chatly-message h2 {
  margin: 0;
  padding: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
}

.GPT-chatly-message h1 {
  font-size: clamp(1.2rem, 2.1vw, 1.8rem);
}

.GPT-chatly-message h2 {
  margin-top: 4px;
  margin-bottom: 10px;
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  color: var(--muted-text);
}

.faq-button {
  position: fixed;
  left: 20px;
  bottom: 18px;
  z-index: 1002;
  width: 52px;
  height: 52px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--text-color);
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

#faq {
  display: none;
}

.chat-gpt-faq {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.faq-question {
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  font-weight: 700;
  cursor: pointer;
}

.faq-answer {
  display: none;
  padding: 10px 10px 10px 18px;
  color: var(--text-color);
}

#image-display-container {
  position: relative;
  display: none;
  justify-content: center;
  align-items: center;
  margin: 12px auto;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

#close-image-display {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--surface-strong);
  color: var(--text-color);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#download-image-button {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 100;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 6px 10px;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:active,
a:visited {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.loader {
  border: 14px solid #e8e8e8;
  border-radius: 50%;
  border-top: 14px solid #4f677c;
  width: 110px;
  height: 110px;
  animation: spin 1.3s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.model-picker-mobile {
  display: none;
}

@media (max-width: 768px) {
  .apps-dock-shell {
    width: auto;
    align-items: flex-end;
  }

  .apps-tabs {
    display: none !important;
  }

  .apps-launcher {
    display: inline-flex !important;
    font-size: 12px;
    padding: 7px 10px;
  }

  .apps-panel {
    display: none !important;
  }

  .header-controls {
    right: 8px;
    top: 8px;
    gap: 6px;
    padding: 5px 6px;
    max-width: calc(100% - 16px);
  }

  .language-button {
    font-size: 17px;
    padding: 2px 6px;
  }

  .slider {
    width: 48px;
    height: 24px;
    padding: 0 6px;
  }

  .slider::before {
    width: 20px;
    height: 20px;
    top: 1px;
    left: 1px;
  }

  input[type='checkbox']:checked + .slider::before {
    transform: translateX(24px);
  }

  .theme-icon {
    width: 11px;
    height: 11px;
  }

  .theme-icon svg {
    width: 11px;
    height: 11px;
  }

  .model-picker-mobile {
    display: block;
    width: 90%;
    margin: 0 auto 10px;
  }

  .sidebar .model-picker {
    display: none;
  }

  .brand {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(86%, 340px);
    height: 100%;
    transition: left 0.3s ease;
    z-index: 1099;
  }

  .menu-icon {
    display: flex;
  }

  #new-chat {
    margin-top: 66px;
  }

  .dropdown {
    text-align: center;
    width: auto;
  }

  .dropdown-content {
    left: 50%;
    transform: translateX(-50%);
  }

  #faq-toggle {
    display: none;
  }

  .GPT-chatly-message {
    width: min(92%, 700px);
    padding: 14px;
  }

  .GPT-chatly-message {
    font-size: 0;
  }

  .GPT-chatly-message::after {
    content: 'GPTchatly - Powered by ChatGPT';
    font-size: 16px;
    color: var(--text-color);
  }

  .messages {
    padding-top: 76px;
  }
}

.messages::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
#session-list::-webkit-scrollbar,
#user-input::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.messages::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
#session-list::-webkit-scrollbar-track,
#user-input::-webkit-scrollbar-track {
  background: transparent;
}

.messages::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
#session-list::-webkit-scrollbar-thumb,
#user-input::-webkit-scrollbar-thumb {
  background: #96a6b7;
  border-radius: 10px;
  border: 2px solid transparent;
}

.messages,
.sidebar,
#session-list,
#user-input {
  scrollbar-width: thin;
  scrollbar-color: #96a6b7 transparent;
}

.toggle-btn {
  border: 1px solid var(--border-color);
  background: var(--surface-muted);
  color: var(--text-color);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 16px;
}

.messages {
  width: 100%;
}

.session-title {
  display: inline-block;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
