/**#command
name: styles.css
answer: 
keyboard: 
parse_mode: markdown
aliases: 
allow_only_group: false
need_reply: false
is_web: 1
#command**/

* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #f4f7fb;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.app-container {
  width: 100%;
  max-width: 440px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #ffffff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.sidebar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 25, 40, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 40;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 82%;
  background: #ffffff;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(-102%);
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 6px 0 30px rgba(15, 25, 40, 0.08);
  border-right: 1px solid #eef2f7;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 14px 18px;
  flex-shrink: 0;
  gap: 10px;
}

.sidebar-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(145deg, #1a2b3c, #0d1824);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(15, 25, 40, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-size: 14.5px;
  font-weight: 600;
  color: #1a2b3c;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: #8fa1b8;
  font-weight: 400;
  margin-top: 2px;
  line-height: 1.2;
}

.sidebar-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.sidebar-close:hover {
  background: #f0f4fa;
}

.sidebar-close svg {
  width: 16px;
  height: 16px;
  stroke: #6b7c93;
  stroke-width: 2;
  fill: none;
}

.sidebar-new-chat {
  margin: 4px 12px 12px 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #1a2b3c;
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(26, 43, 60, 0.15);
}

.sidebar-new-chat:hover {
  background: #0d1824;
}

.sidebar-new-chat:active {
  transform: scale(0.98);
}

.sidebar-new-chat .new-chat-icon {
  width: 18px;
  height: 18px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-new-chat .new-chat-icon svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  stroke-width: 1.9;
  fill: none;
}

.sidebar-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #a3b3c9;
  padding: 10px 20px 8px 20px;
  flex-shrink: 0;
}

.sidebar-section-label .history-count {
  font-size: 10.5px;
  font-weight: 500;
  color: #a3b3c9;
  background: #f0f4fa;
  padding: 1px 7px;
  border-radius: 8px;
  text-transform: none;
  letter-spacing: 0;
}

.sidebar-history {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 10px 10px;
  -webkit-overflow-scrolling: touch;
}

.sidebar-history::-webkit-scrollbar {
  width: 4px;
}

.sidebar-history::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-history::-webkit-scrollbar-thumb {
  background: #d9e2ef;
  border-radius: 12px;
}

.history-group-label {
  font-size: 10.5px;
  font-weight: 600;
  color: #b8c5d6;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 10px 6px 10px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
  position: relative;
  group: history;
}

.history-item:hover {
  background: #f4f7fb;
}

.history-item.active {
  background: #eaf0f8;
}

.history-item .history-icon {
  width: 15px;
  height: 15px;
  stroke: #8fa1b8;
  stroke-width: 1.8;
  fill: none;
  flex-shrink: 0;
}

.history-item.active .history-icon {
  stroke: #1a2b3c;
}

.history-item .history-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.history-item .history-title {
  font-size: 13.5px;
  color: #4a5b70;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.history-item.active .history-title {
  color: #1a2b3c;
  font-weight: 500;
}

.history-item .history-meta {
  font-size: 10.5px;
  color: #b8c5d6;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-delete {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  flex-shrink: 0;
}

.history-item:hover .history-delete,
.history-item.active .history-delete {
  opacity: 1;
}

.history-delete:hover {
  background: #fdeaea;
}

.history-delete svg {
  width: 13px;
  height: 13px;
  stroke: #8fa1b8;
  stroke-width: 2;
  fill: none;
}

.history-delete:hover svg {
  stroke: #e45649;
}

.history-empty {
  padding: 40px 20px;
  text-align: center;
  color: #a3b3c9;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}

.history-empty svg {
  width: 32px;
  height: 32px;
  stroke: #cfd9e6;
  stroke-width: 1.5;
  fill: none;
  margin-bottom: 12px;
}

.sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid #f0f4fa;
  padding: 12px 16px 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fafbfd;
}

.dev-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.25);
}

.dev-info {
  flex: 1;
  min-width: 0;
}

.dev-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a2b3c;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.dev-role {
  font-size: 11px;
  color: #8fa1b8;
  font-weight: 400;
  margin-top: 2px;
  line-height: 1.2;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  height: 56px;
  flex-shrink: 0;
  padding-top: 8px;
  gap: 12px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f4fa;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.icon-btn:active {
  background: #e2e8f2;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: #1a2b3c;
  stroke-width: 1.8;
  fill: none;
}

.chat-title {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #1a2b3c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
  letter-spacing: -0.01em;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

.welcome-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  animation: fadeIn 0.4s ease;
}

.welcome-hero .hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(145deg, #eaf0f8, #dbe6f5);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(26, 43, 60, 0.06);
}

.welcome-hero .hero-icon svg {
  width: 28px;
  height: 28px;
  stroke: #1a2b3c;
  stroke-width: 1.8;
  fill: none;
}

.welcome-hero h2 {
  font-size: 22px;
  font-weight: 600;
  color: #1a2b3c;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.welcome-hero p {
  font-size: 14px;
  color: #8fa1b8;
  font-weight: 400;
  max-width: 240px;
  line-height: 1.5;
}

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

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

.bottom-bar {
  padding: 8px 16px 16px 16px;
  background: #ffffff;
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: #f2f6fc;
  border-radius: 28px;
  padding: 6px 6px 6px 16px;
  gap: 8px;
  transition: background 0.2s, box-shadow 0.2s;
  border: 1px solid transparent;
}

.input-wrapper:focus-within {
  background: #ffffff;
  border-color: #cbd8e8;
  box-shadow: 0 4px 12px rgba(0, 100, 255, 0.04);
}

.input-wrapper input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: #1a2b3c;
  padding: 6px 0;
  font-weight: 400;
}

.input-wrapper input::placeholder {
  color: #8fa1b8;
}

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a2b3c;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s, background 0.2s;
  flex-shrink: 0;
}

.send-btn:active {
  transform: scale(0.92);
  background: #0d1824;
}

.send-btn svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  stroke-width: 2.2;
  fill: none;
}

.chat-messages {
  display: none;
}

.msg-content {
  line-height: 1.6;
  font-size: 15px;
  color: #1a2b3c;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.msg-content p {
  margin-bottom: 10px;
}

.msg-content p:last-child {
  margin-bottom: 0;
}

.msg-content strong {
  font-weight: 600;
  color: #0d1824;
}

.msg-content em {
  font-style: italic;
}

.msg-content a {
  color: #0066ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 102, 255, 0.2);
}

.msg-content a:hover {
  border-bottom-color: #0066ff;
}

.msg-content code:not(pre code) {
  background: #eef2f7;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Fira Code', monospace;
  font-size: 13px;
  color: #d63384;
  border: 1px solid #e2e8f2;
}

.code-block-wrapper {
  margin: 12px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e1e4e8;
  background: #fafbfc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #f1f3f5;
  border-bottom: 1px solid #e1e4e8;
  font-size: 12px;
  color: #6b7c93;
  font-weight: 500;
}

.code-header .lang-label {
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}

.code-header .copy-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: #6b7c93;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.code-header .copy-btn:hover {
  background: #e2e8f2;
  color: #1a2b3c;
}

.code-header .copy-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.code-block-wrapper pre {
  margin: 0;
  background: #fafbfc !important;
  border: none !important;
  border-radius: 0 !important;
  overflow-x: auto;
}

.code-block-wrapper pre code,
.code-block-wrapper pre code[class*="language-"],
.code-block-wrapper code[class*="language-"] {
  display: block;
  background: transparent !important;
  color: #383a42;
  padding: 14px 16px !important;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Fira Code', 'Consolas', monospace !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  border: none !important;
  text-shadow: none !important;
  white-space: pre;
  -webkit-font-smoothing: antialiased;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #a0a1a7;
  font-style: italic;
}

.token.punctuation {
  color: #383a42;
}

.token.namespace {
  opacity: 0.7;
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
  color: #e45649;
}

.token.boolean,
.token.number {
  color: #986801;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #50a14f;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #383a42;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #a626a4;
}

.token.function,
.token.class-name {
  color: #4078f2;
}

.token.regex,
.token.important,
.token.variable {
  color: #e45649;
}

.token.important,
.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}

.msg-content ul,
.msg-content ol {
  padding-left: 24px;
  margin: 10px 0;
}

.msg-content li {
  margin-bottom: 6px;
  line-height: 1.55;
}

.msg-content li::marker {
  color: #6b7c93;
}

.msg-content blockquote {
  border-left: 3px solid #cbd8e8;
  padding-left: 14px;
  margin: 10px 0;
  color: #6b7c93;
  font-style: italic;
}

.msg-content hr {
  border: none;
  border-top: 1px solid #e2e8f2;
  margin: 16px 0;
}

.msg-content .table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  margin: 12px 0;
  border: 1px solid #e2e8f2;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.msg-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 100%;
}

.msg-content thead {
  background: #f0f4fa;
}

.msg-content th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: #1a2b3c;
  border-bottom: 1px solid #e2e8f2;
  border-right: 1px solid #e2e8f2;
  white-space: nowrap;
}

.msg-content th:last-child {
  border-right: none;
}

.msg-content td {
  padding: 10px 14px;
  text-align: left;
  color: #1a2b3c;
  border-bottom: 1px solid #eef2f7;
  border-right: 1px solid #eef2f7;
}

.msg-content td:last-child {
  border-right: none;
}

.msg-content tbody tr:last-child td {
  border-bottom: none;
}

.msg-content tbody tr:nth-child(even) {
  background: #fafbfd;
}

.msg-content h1,
.msg-content h2,
.msg-content h3,
.msg-content h4,
.msg-content h5,
.msg-content h6 {
  margin: 16px 0 8px 0;
  font-weight: 600;
  line-height: 1.3;
  color: #0d1824;
}

.msg-content h1 {
  font-size: 1.35em;
}

.msg-content h2 {
  font-size: 1.2em;
}

.msg-content h3 {
  font-size: 1.1em;
}

.msg-content h4,
.msg-content h5,
.msg-content h6 {
  font-size: 1em;
}

.msg-content h1:first-child,
.msg-content h2:first-child,
.msg-content h3:first-child,
.msg-content h4:first-child,
.msg-content h5:first-child,
.msg-content h6:first-child {
  margin-top: 0;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #8fa1b8;
  border-radius: 50%;
  display: inline-block;
  animation: bounce 1.4s infinite ease-in-out both;
}

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

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

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

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.main-content::-webkit-scrollbar {
  width: 4px;
}

.main-content::-webkit-scrollbar-track {
  background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
  background: #d9e2ef;
  border-radius: 12px;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: #c2cedf;
}