/* ── Sidebar ── */
#scripty_sidebar {
  font-size: 0.9rem;
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#scripty_sidebar h5 {
  font-weight: 600;
  margin-bottom: .75rem;
  color: #c8d6e5;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

#scripty_sidebar .input-group {
  margin-bottom: .75rem;
  flex-shrink: 0;
}

#scripty_sidebar input[type="text"] {
  background-color: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: #c8d6e5;
  font-size: 0.85rem;
  border-radius: 6px 0 0 6px;
}

#scripty_sidebar input[type="text"]::placeholder {
  color: rgba(200,214,229,0.38);
}

#scripty_sidebar .input-group-text {
  background-color: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: rgba(200,214,229,0.5);
  border-radius: 0 6px 6px 0;
}

#session-list {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
}

.session-item {
  cursor: pointer;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: rgba(200,214,229,0.7);
  transition: background-color .15s ease, color .15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.session-item:hover {
  background-color: rgba(255,255,255,0.07);
  color: #c8d6e5;
}

.session-item.active {
  background-color: rgba(0,96,138,0.38);
  color: #e0ecf8;
  font-weight: 500;
}

/* ── Header ── */
#scripty_header {
  border-bottom: 1px solid rgba(255,255,255,0.07);
  gap: 8px;
}

#scripty_header h1 {
  font-size: 0.97rem;
  font-weight: 500;
  color: #c8d6e5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  flex: 1;
  min-width: 0;
}

/* ── Sidebar toggle (mobile) ── */
#scripty_sidebar_toggle {
  display: none;
  background: none;
  border: none;
  color: #c8d6e5;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.14s;
  flex-shrink: 0;
  line-height: 1;
}

#scripty_sidebar_toggle:hover {
  background: rgba(255,255,255,0.08);
}

/* ── Chat ── */
#chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#chat p.sender {
  align-self: flex-end;
  max-width: 76%;
  background-color: rgba(0,100,160,0.45);
  color: #e2edf7;
  border-radius: 14px 14px 4px 14px;
  padding: 8px 13px;
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.88rem;
  line-height: 1.45;
}

#chat p.assistant {
  align-self: flex-start;
  max-width: 88%;
  background-color: rgba(255,255,255,0.07);
  color: #c8d6e5;
  border-radius: 4px 14px 14px 14px;
  padding: 8px 13px;
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.88rem;
  line-height: 1.45;
}

/* ── Code blocks ── */
.code-container {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.28);
  align-self: flex-start;
  max-width: 100%;
}

.code-container pre {
  margin: 0;
  padding: .85rem 1rem;
  overflow-x: auto;
  font-size: 0.8rem;
}

.copy-btn {
  position: absolute !important;
  top: 7px;
  right: 7px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: #c8d6e5;
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background 0.14s;
}

.copy-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* ── Input area ── */
#scripty_input {
  border-top: 1px solid rgba(255,255,255,0.07);
}

#scripty_input textarea {
  resize: none;
  height: 100%;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  font-size: 0.9rem;
  background-color: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: #c8d6e5;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#scripty_input textarea:focus {
  background-color: rgba(255,255,255,0.09);
  border-color: rgba(0,100,160,0.65);
  box-shadow: 0 0 0 2px rgba(0,100,160,0.2);
  color: #c8d6e5;
  outline: none;
}

#scripty_input textarea::placeholder {
  color: rgba(200,214,229,0.36);
}

#scripty_input button#send {
  border-radius: 0 10px 10px 0;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  #scripty_sidebar_toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
