:root {
  --lc-bg: #212121;
  --lc-sidebar: #171717;
  --lc-surface: #2f2f2f;
  --lc-border: #3f3f3f;
  --lc-text: #ececec;
  --lc-muted: #9b9b9b;
  --lc-user-bg: #303030;
  --lc-bot-bg: transparent;
  --lc-accent: #10a37f;
  --lc-accent-hover: #0d8c6d;
  --lc-radius: 12px;
  --lc-font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --lc-header-h: 52px;
  --lc-composer-h: auto;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.lc-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.lake-chat-page {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--lc-font);
  background: var(--lc-bg);
  color: var(--lc-text);
  line-height: 1.55;
}

.lc-app {
  display: flex;
  min-height: 100dvh;
}

/* Sidebar */
.lc-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--lc-sidebar);
  border-right: 1px solid var(--lc-border);
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  gap: 0.75rem;
}

.lc-sidebar-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lc-sidebar-close {
  display: none;
  margin-left: auto;
}

.lc-sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lc-sidebar-links a {
  color: var(--lc-muted);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.lc-sidebar-links a:hover {
  background: var(--lc-surface);
  color: var(--lc-text);
}

.lc-sidebar-note {
  margin: auto 0 0;
  font-size: 0.75rem;
  color: var(--lc-muted);
  padding: 0 0.35rem;
}

.lc-sidebar-backdrop {
  display: none;
}

/* Main */
.lc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.lc-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: var(--lc-header-h);
  padding: 0 0.75rem;
  border-bottom: 1px solid var(--lc-border);
  flex-shrink: 0;
}

.lc-header-brand {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.lc-header-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.lc-header-domain {
  display: block;
  font-size: 0.72rem;
  color: var(--lc-muted);
}

.lc-header-domain strong {
  color: var(--lc-accent);
  font-weight: 600;
}

.lc-header-spacer {
  width: 36px;
  flex-shrink: 0;
}

/* Buttons */
.lc-btn {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  transition: background 0.15s, opacity 0.15s;
}

.lc-btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--lc-text);
}

.lc-btn-icon:hover {
  background: var(--lc-surface);
}

.lc-btn-new {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  background: transparent;
  color: var(--lc-text);
  border: 1px solid var(--lc-border);
  font-size: 0.875rem;
}

.lc-btn-new:hover {
  background: var(--lc-surface);
}

.lc-btn-send {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--lc-accent);
  color: #fff;
  border-radius: 8px;
}

.lc-btn-send:hover:not(:disabled) {
  background: var(--lc-accent-hover);
}

.lc-btn-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Messages area */
.lc-messages-wrap {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.lc-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.25rem;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.lc-welcome.lc-welcome--hidden {
  display: none;
}

.lc-welcome-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.lc-welcome h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 600;
}

.lc-welcome p {
  margin: 0 0 1.25rem;
  color: var(--lc-muted);
  font-size: 0.95rem;
}

.lc-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  width: 100%;
  max-width: 520px;
}

.lc-suggestion {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.65rem 0.85rem;
  background: var(--lc-surface);
  color: var(--lc-text);
  border: 1px solid var(--lc-border);
  border-radius: var(--lc-radius);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.lc-suggestion:hover {
  background: #3a3a3a;
}

.lc-messages {
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  padding: 1rem 1rem 0.5rem;
}

.lc-msg {
  display: flex;
  gap: 0.85rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid transparent;
}

.lc-msg--user {
  background: var(--lc-user-bg);
  margin: 0 -1rem;
  padding: 1.1rem 1rem;
}

.lc-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.lc-msg--user .lc-msg-avatar {
  background: #5436da;
  color: #fff;
}

.lc-msg--bot .lc-msg-avatar {
  background: var(--lc-accent);
  color: #fff;
}

.lc-msg-body {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
}

.lc-msg-body p {
  margin: 0 0 0.65rem;
}

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

.lc-msg-body strong {
  font-weight: 600;
}

.lc-msg-body ul {
  margin: 0.35rem 0 0.65rem;
  padding-left: 1.25rem;
}

.lc-msg-body li {
  margin-bottom: 0.25rem;
}

.lc-msg--typing .lc-msg-body {
  color: var(--lc-muted);
}

.lc-msg--typing .lc-dots span {
  animation: lc-blink 1.2s infinite;
}

.lc-msg--typing .lc-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.lc-msg--typing .lc-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes lc-blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

/* Composer */
.lc-composer {
  flex-shrink: 0;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--lc-border);
  background: var(--lc-bg);
}

.lc-form {
  max-width: 768px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: var(--lc-surface);
  border: 1px solid var(--lc-border);
  border-radius: 1.25rem;
  padding: 0.55rem 0.65rem 0.55rem 1rem;
  transition: border-color 0.15s;
}

.lc-form:focus-within {
  border-color: #565656;
}

.lc-form textarea {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--lc-text);
  font: inherit;
  font-size: 0.9375rem;
  resize: none;
  max-height: 200px;
  line-height: 1.45;
  padding: 0.35rem 0;
}

.lc-form textarea:focus {
  outline: none;
}

.lc-form textarea::placeholder {
  color: var(--lc-muted);
}

.lc-disclaimer {
  max-width: 768px;
  margin: 0.55rem auto 0;
  font-size: 0.7rem;
  color: var(--lc-muted);
  text-align: center;
  line-height: 1.4;
}

/* Mobile sidebar */
@media (max-width: 768px) {
  .lc-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

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

  .lc-sidebar-close {
    display: inline-flex;
  }

  .lc-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0, 0, 0, 0.55);
  }

  .lc-sidebar-backdrop:not([hidden]) {
    display: block;
  }
}
