/* ── Linzy AI Chat View Styles ────────────────────────────────────────────── */
/* Perfectly aligned with Assistant layout, history drawer, and clean typography */

.view.view-lensy,
.view.view-linzy {
  max-width: 100%;
  padding: 12px 28px 14px;
  height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Lensy & Linzy Layout & Main Chat */
.lensy-layout,
.linzy-layout {
  display: flex;
  gap: 20px;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  position: relative;
  align-items: stretch;
  overflow: hidden;
}

.linzy-main {
  flex: 1;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

.linzy-chatwrap {
  max-width: 100%;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  padding-bottom: 16px;
  scroll-behavior: smooth;
}

[dir="rtl"] .linzy-chatwrap {
  padding-right: 0;
  padding-left: 8px;
}

.linzy-chatwrap::-webkit-scrollbar {
  width: 6px;
}
.linzy-chatwrap::-webkit-scrollbar-track {
  background: transparent;
}
.linzy-chatwrap::-webkit-scrollbar-thumb {
  background: var(--line-strong, rgba(255, 255, 255, 0.15));
  border-radius: 3px;
}

/* Linzy Avatar */
.avatar.linzy-avatar {
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Linzy Empty State */
.linzy-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  margin: auto;
}

/* Markdown Code Blocks */
.code-wrap {
  margin: 10px 0;
  border-radius: var(--r-sm, 6px);
  background: var(--ink, #0f172a);
  color: #c9d6d1;
  overflow: hidden;
  border: 1px solid var(--line-soft, #334155);
}
.code-wrap .code-head {
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.04em;
}
.code-wrap pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre;
}

/* Markdown Tables */
.table-wrap {
  margin: 12px 0;
  overflow-x: auto;
  border-radius: var(--r-sm, 6px);
  border: 1px solid var(--line);
}
.table-wrap .data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table-wrap th,
.table-wrap td {
  padding: 8px 12px;
  border: 1px solid var(--line-soft);
  text-align: start;
}
.table-wrap th {
  background: var(--surface-2, rgba(0, 0, 0, 0.02));
  font-weight: 600;
  color: var(--text);
}

/* Legacy studio elements suppression */
.linzy-preview-pane,
.linzy-mobile-tabs,
.linzy-suggestions,
.linzy-brand-sub,
.linzy-msg-quick-bar,
.linzy-rec-item,
.linzy-dash-embed-card,
.linzy-sql-details {
  display: none !important;
}

/* ── Linzy Option B: Claude-Style Dynamic Artifacts ──────────────────────── */
.linzy-artifact-card {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.linzy-artifact-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.08);
}

.linzy-artifact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2, rgba(0, 0, 0, 0.02));
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.linzy-artifact-title-area {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.linzy-artifact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(139, 92, 246, 0.16));
  color: #6366f1;
  flex-shrink: 0;
}

.linzy-artifact-title-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.linzy-artifact-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.linzy-artifact-subtitle {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.01em;
}

.linzy-artifact-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.linzy-artifact-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--line-soft, rgba(0, 0, 0, 0.06));
  padding: 2px;
  border-radius: 7px;
}

.linzy-artifact-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  color: var(--text-2);
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.linzy-artifact-tab:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

.linzy-artifact-tab.active {
  background: var(--surface);
  color: #6366f1;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.linzy-artifact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
}

.linzy-artifact-btn:hover {
  color: #6366f1;
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.04);
}

.linzy-artifact-pane {
  width: 100%;
}

.linzy-artifact-frame {
  width: 100%;
  height: 330px;
  border: none;
  display: block;
  background: transparent;
}

.linzy-artifact-code-pane {
  background: #090d16;
  position: relative;
}

.linzy-code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.linzy-code-lang {
  font-family: var(--mono);
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.linzy-copy-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
}

.linzy-copy-code-btn:hover {
  background: rgba(99, 102, 241, 0.35);
  border-color: #6366f1;
}

.linzy-artifact-code {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  max-height: 330px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
  color: #e2e8f0;
  white-space: pre;
}

/* Fullscreen Popout Modal */
.linzy-artifact-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.linzy-artifact-modal.open {
  display: flex;
}

.linzy-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}

.linzy-modal-window {
  position: relative;
  z-index: 1;
  width: 90vw;
  max-width: 1100px;
  height: 85vh;
  background: var(--surface, #0f172a);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.linzy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-2, rgba(255, 255, 255, 0.03));
  border-bottom: 1px solid var(--line-soft, rgba(255, 255, 255, 0.08));
}

.linzy-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.linzy-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.linzy-modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  color: var(--text-2);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.linzy-modal-btn:hover {
  color: #6366f1;
  border-color: rgba(99, 102, 241, 0.35);
}

.linzy-modal-close {
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.linzy-modal-close:hover {
  color: var(--text);
}

.linzy-modal-body {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

@media (max-width: 640px) {
  .linzy-artifact-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .linzy-artifact-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* ── Collapsible Raw Data Table (when Artifact Card is active) ──────────── */
.linzy-raw-table-details {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.linzy-raw-table-details[open] {
  border-color: var(--line-active, rgba(99, 102, 241, 0.35));
}

.linzy-raw-table-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2, rgba(0, 0, 0, 0.02));
  transition: color 0.15s ease, background 0.15s ease;
  list-style: none;
}

.linzy-raw-table-summary::-webkit-details-marker {
  display: none;
}

.linzy-raw-table-summary:hover {
  color: var(--text);
  background: var(--surface-3, rgba(0, 0, 0, 0.04));
}

.linzy-raw-table-summary svg {
  transition: transform 0.2s ease;
}

.linzy-raw-table-details[open] .linzy-raw-table-summary svg {
  transform: rotate(90deg);
}

.linzy-raw-table-body {
  padding: 10px 12px;
  overflow-x: auto;
}

.linzy-raw-table-body .table-wrap {
  margin: 0;
  border: none;
  border-radius: 0;
}

/* ── Clarification Chips (Interactive Turn-Based Disambiguation) ────────── */
.clarification-chips-wrapper {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(99, 102, 241, 0.05);
  border: 1px dashed rgba(99, 102, 241, 0.35);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.clarification-chips-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #818cf8;
  letter-spacing: 0.01em;
}
.clarification-chips-label svg {
  flex-shrink: 0;
}
.clarification-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.clarification-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  user-select: none;
  text-align: start;
}
.clarification-chip .chip-spark {
  color: #a855f7;
  font-size: 11px;
  transition: transform 0.2s ease;
}
.clarification-chip:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.12);
  border-color: #818cf8;
  color: #c7d2fe;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.clarification-chip:hover:not(:disabled) .chip-spark {
  transform: scale(1.25);
  color: #ec4899;
}
.clarification-chip:active:not(:disabled) {
  transform: translateY(0);
}
.clarification-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.clarification-chip.chip-selected {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: #a855f7;
  color: #ffffff;
  opacity: 1;
}
.clarification-chip.chip-selected .chip-spark {
  color: #ffffff;
}

.clarification-chip-custom {
  border-style: dashed;
  border-color: rgba(129, 140, 248, 0.5);
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.08);
}
.clarification-chip-custom:hover:not(:disabled) {
  border-style: solid;
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.18);
  color: #ffffff;
}
.clarification-custom-container {
  margin-top: 4px;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.clarification-custom-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid rgba(129, 140, 248, 0.6);
  border-radius: 8px;
  padding: 4px 6px 4px 12px;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.2);
}
.clarification-custom-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
}
.clarification-custom-input::placeholder {
  color: var(--text-dim, #94a3b8);
}
.clarification-custom-submit {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.clarification-custom-submit:hover {
  filter: brightness(1.15);
  transform: scale(1.05);
}



