/* Force transparent background for all common chart/graph containers and elements */
.chart, .graph, .plot, .figure, canvas, svg {
  background: transparent !important;
}
:root {
  /* color-scheme: light; */
  --paper: #f9fafb;
  --paper-2: #f2f4f7;
  --ink: #f1f1f1;
  --ink-muted: #667085;
  --accent: #f04438;
  --accent-2: #175cd3;
  --panel: #ffffff;
  --line: #eaecf0;
  --line-strong: #d0d5dd;
}


* {
  font-family: 'Satoshi', ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}

/* html, body {
  color-scheme: light;
} */

body {
  font-family: 'Satoshi', ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  background: linear-gradient(180deg, #303b57 0%, #0c121e 100%);
  color: var(--ink-muted);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  height: 100vh;
  background: transparent;
}

.sidebar-backdrop,
.mobile-only-inline {
  display: none;
}

.sidebar {
  background: transparent;
  /* border-right: 1px solid var(--line); */
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header h1,
.hero-title {
  color: #ffffff !important;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 6px;
  flex: 1;
}

* {
  scrollbar-color: #ffffff transparent;
  scrollbar-width: thin;
}

*:hover {
  scrollbar-color: #ffffff transparent !important;
}

*:hover::-webkit-scrollbar-thumb {
  background: #ffffff !important;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #ffffff;
  border-radius: 999px;
}

.chat-item {
  width: 100%;
  text-align: left;
  border-radius: 10px;
  padding: 10px 12px;
  /* border: 1px solid var(--line); */
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  transition: all 160ms ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-item:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.chat-item.is-active {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.chat-item-title {
  font-weight: 370;
  font-size: 0.86rem;
}

.chat-title-input {
  font: inherit;
  font-weight: 600;
  font-size: 0.86rem;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 2px 6px;
  background: #ffffff;
  color: var(--ink);
}

.chat-title-input:focus {
  outline: none;
  border-color: #f97066;
  box-shadow: 0 0 0 2px rgba(240, 68, 56, 0.12);
}

.chat-item-meta {
  font-size: 0.75rem;
  color: #9CA3AF;
  margin-top: 2px;
}

.chat-item-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.chat-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-item-edit,
.chat-item-delete {
  border: 1px solid transparent;
  background: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 150ms ease;
}

.chat-item-edit {
  color: var(--ink-muted);
}

.chat-item-delete {
  color: #b42318;
}

.chat-item:hover .chat-item-delete,
.chat-item-actions:hover .chat-item-delete,
.chat-item-actions:focus-within .chat-item-delete {
  opacity: 1;
  pointer-events: auto;
  border-color: rgba(255, 119, 104, 0.5);
}

.chat-item:hover .chat-item-edit,
.chat-item-actions:hover .chat-item-edit,
.chat-item-actions:focus-within .chat-item-edit {
  opacity: 1;
  pointer-events: auto;
  border-color: #d0d5dd;
}

.chat-item-edit:hover {
  background: #f2f4f7;
  border-color: #98a2b3;
}

.chat-item-delete:hover {
  background: #fef3f2;
  border-color: #f97066;
}

.chat-item-edit svg,
.chat-item-delete svg {
  width: 14px;
  height: 14px;
}

.main-panel {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 9px clamp(3px, 1vw, 13px) 6px;
  background: transparent;
  /* border-bottom: 1px solid var(--line); */
  flex-shrink: 0;
}

.hero-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 385;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-sub {
  color: #9CA3AF;
  font-size: 0.89rem;
  max-width: 75ch;
}

.chat-content-wrapper {
  flex: 1;
  overflow-y: auto;
  background: transparent;
}

.chat-panel {
  background: transparent;
  padding: 20px 20px 24px;
}

.chat-input-area {
  padding: 18px clamp(18px, 4vw, 48px) 28px;
  background: transparent;
  /* border-top: 1px solid var(--line); */
  flex-shrink: 0;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eff8ff;
  color: #175cd3;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Input and button polish aligned to the design-system look */
#msg,
textarea#msg,
.uk-textarea {
  border-radius: 12px;
  min-height: 2.5rem;
  max-height: 2.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-family: 'Martel Sans', ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}

#msg:focus,
textarea#msg:focus,
.uk-textarea:focus {
  outline: none;
  border-color: #84caff;
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.14);
}

#chat-send-btn,
button#chat-send-btn,
#new-chat-btn,
button#new-chat-btn,
#close-sidebar-btn,
button#close-sidebar-btn,
#open-sidebar-btn,
button#open-sidebar-btn,
.uk-button,
button {
  border-radius: 12px;
  font-family: 'Martel Sans', ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}

#new-chat-btn,

button#new-chat-btn {
  width: 87%;
  background: #f1f1f1;
  color: #fff;
  transition: box-shadow 0.26s, transform 0.26s, background 0.34s, color 0.22s;
  position: relative;
  overflow: hidden;
}

button#new-chat-btn::before {
  content: '';
  position: absolute;
  top: -4px; left: -4px; right: -4px; bottom: -4px;
  z-index: 0;
  background: linear-gradient(270deg, #303B57, #0C121E, #23283A, #1A1C26, #8ACFF9, #303B57);
  background-size: 400% 400%;
  filter: blur(8px) brightness(1.3);
  opacity: 0.85;
  animation: neon-animate 6s linear infinite;
  border-radius: 16px;
  transition: opacity 0.3s;
}

button#new-chat-btn:hover::before {
  opacity: 1;
}

button#new-chat-btn > * {
  position: relative;
  z-index: 1;
}

@keyframes neon-animate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#new-chat-btn:hover,
button#new-chat-btn:hover {
  background: #F1F1F1;
  color: #0C121E;
  transform: scale(1.07);
  box-shadow: 0 4px 18px 0 rgba(44, 62, 80, 0.13), 0 1.5px 4px 0 rgba(44, 62, 80, 0.10);
}

#chat-send-btn,
button#chat-send-btn {
  background: #f1f1f1;
  border: 1px solid #f1f1f1;
  color: #0c121e;
}

#chat-send-btn:hover,
button#chat-send-btn:hover {
  background: #d1d5db;
}



.chat-row-assistant {
  background: transparent;
}

.delete-chat-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(16, 24, 40, 0.36);
}

.delete-chat-modal.is-open {
  display: flex;
}

.delete-chat-modal-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 18px 36px rgba(16, 24, 40, 0.14);
  padding: 20px;
}

.delete-chat-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0C121E;
}

.delete-chat-modal-text {
  margin: 10px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

.delete-chat-modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.delete-chat-confirm-btn,
button.delete-chat-confirm-btn {
  background: #b42318;
  border: 1px solid #b42318;
  color: #ffffff;
}

.delete-chat-confirm-btn:hover,
button.delete-chat-confirm-btn:hover {
  background: #912018;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(84vw, 320px);
    height: 100dvh;
    z-index: 40;
    /* border-right: 1px solid var(--line); */
    border-bottom: none;
    transform: translateX(-105%);
    transition: transform 200ms ease;
    box-shadow: 0 18px 36px rgba(16, 24, 40, 0.14);
  }

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

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.24);
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

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

  .mobile-only-inline {
    display: inline-flex;
  }

  .main-panel {
    height: 100dvh;
  }

  .hero {
    padding: 16px 14px 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .chat-content-wrapper {
    padding: 14px;
  }

  .chat-input-area {
    padding: 12px 14px 22px;
  }

  .hero .flex.gap-2.justify-end {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .chat-panel {
    padding: 14px 12px 18px;
    border-radius: 12px;
  }

  .hero .flex.gap-2 {
    gap: 0.5rem;
  }

  .delete-chat-modal-card {
    border-radius: 12px;
    padding: 16px;
  }
}
