html,
body {
  min-height: 100%;
  margin: 0;
  background: #fdfdfd;
  color: #1a1c1c;
  font-family: Poppins, Verdana, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
}

.preview-shell {
  position: relative;
  min-height: 100dvh;
  padding: 88px 16px 136px;
  background-color: #fdfdfd;
  background-image:
    linear-gradient(180deg, rgba(89, 214, 253, 0.08) 0%, rgba(253, 253, 253, 0) 210px),
    linear-gradient(#f0f0f0 1px, transparent 1px),
    linear-gradient(90deg, #f0f0f0 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
  isolation: isolate;
}

.isometric-shape {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
}

.isometric-shape svg {
  display: block;
  width: 100%;
  height: 100%;
}

.isometric-shape path:first-child {
  fill: rgba(15, 130, 245, 0.05);
  stroke: #0f82f5;
  stroke-width: 1;
}

.isometric-shape path + path {
  fill: none;
  stroke: #0f82f5;
  stroke-width: 0.5;
}

.isometric-shape-top {
  top: 68px;
  right: 44px;
  width: 200px;
  height: 200px;
}

.isometric-shape-bottom {
  left: 56px;
  bottom: 120px;
  width: 150px;
  height: 150px;
  transform: rotate(12deg);
}

.isometric-shape-bottom path:first-child {
  fill: rgba(128, 53, 132, 0.05);
  stroke: #803584;
}

.app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  border-bottom: 1px solid #c4c7c7;
  background: rgba(249, 249, 249, 0.82);
  box-shadow: 0 1px 8px rgba(29, 30, 41, 0.05);
  backdrop-filter: blur(14px);
}

.app-topbar::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #0f82f5 0%, #59d6fd 34%, #803584 68%, #5143d5 100%);
  content: "";
  opacity: 0.86;
}

.app-logo {
  position: relative;
  width: 150px;
  height: 54px;
  background-image: var(--lightiq-logo-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.theme-toggle {
  position: absolute;
  right: 16px;
  display: grid;
  place-items: center;
  width: 76px;
  height: 40px;
  padding: 4px;
  border: 1px solid rgba(15, 130, 245, 0.24);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(89, 214, 253, 0.12));
  box-shadow: 0 8px 20px rgba(15, 130, 245, 0.1);
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 130, 245, 0.48);
  box-shadow: 0 10px 26px rgba(15, 130, 245, 0.14);
}

.theme-toggle:focus-visible {
  outline: 2px solid #0f82f5;
  outline-offset: 3px;
}

.theme-toggle-track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(15, 130, 245, 0.14), rgba(89, 214, 253, 0.24));
}

.theme-toggle-icon {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 20px;
  height: 20px;
  pointer-events: none;
  transform: translateY(-50%);
  transition:
    color 180ms ease,
    opacity 180ms ease;
}

.theme-toggle-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle-icon-sun {
  left: 5px;
  color: #ffffff;
  opacity: 1;
}

.theme-toggle-icon-moon {
  right: 5px;
  color: #0f82f5;
  opacity: 0.56;
}

.theme-toggle-thumb {
  position: absolute;
  z-index: 1;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0f82f5;
  box-shadow:
    0 0 0 4px rgba(15, 130, 245, 0.14),
    0 3px 8px rgba(29, 30, 41, 0.18);
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.welcome-panel {
  width: min(800px, 100%);
  margin: 0 auto 24px;
  padding: 36px 0 18px;
  text-align: center;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    max-height 260ms ease,
    margin 260ms ease,
    padding 260ms ease;
}

.welcome-panel h1 {
  margin: 0 0 10px;
  background: linear-gradient(90deg, #090909 0%, #0f82f5 50%, #803584 100%);
  color: #090909;
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-panel p {
  width: min(560px, 100%);
  margin: 0 auto;
  color: #444748;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.prompt-chip {
  --chip-accent: #0f82f5;
  --chip-border: rgba(15, 130, 245, 0.2);
  --chip-bg: rgba(15, 130, 245, 0.06);
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.64)),
    var(--chip-bg);
  color: #444748;
  box-shadow: inset 0 -2px 0 var(--chip-bg);
  cursor: pointer;
  font: 500 12px/1.4 Poppins, Verdana, sans-serif;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.prompt-chip:nth-child(2) {
  --chip-accent: #803584;
  --chip-border: rgba(128, 53, 132, 0.24);
  --chip-bg: rgba(128, 53, 132, 0.07);
}

.prompt-chip:nth-child(3) {
  --chip-accent: #5143d5;
  --chip-border: rgba(81, 67, 213, 0.24);
  --chip-bg: rgba(81, 67, 213, 0.07);
}

.prompt-chip:hover,
.prompt-chip:focus-visible {
  border-color: var(--chip-accent);
  background:
    linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.78)),
    var(--chip-bg);
  color: var(--chip-accent);
  outline: none;
  transform: translateY(-1px);
}

body.chat-started .welcome-panel {
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-10px);
}

#n8n-chat {
  position: relative;
  z-index: 1;
  width: min(800px, 100%);
  min-height: 320px;
  margin: 0 auto;
}

.preview-status {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10000;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(29, 30, 41, 0.12);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 40px rgba(29, 30, 41, 0.16);
  color: #1d1e29;
  font-size: 14px;
  line-height: 1.45;
}

.ai-disclaimer {
  position: fixed !important;
  right: 16px !important;
  bottom: 9px !important;
  left: 16px !important;
  z-index: 37 !important;
  display: block !important;
  width: min(800px, calc(100vw - 32px)) !important;
  margin: 0 auto !important;
  padding: 0 10px !important;
  color: rgba(68, 71, 72, 0.82) !important;
  font-size: 11px !important;
  font-weight: 300 !important;
  line-height: 1.35 !important;
  text-align: center !important;
  pointer-events: none !important;
}

.ai-disclaimer::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f82f5, #803584);
  content: "";
  vertical-align: 1px;
}

.chat-window-wrapper,
.chat-window,
.chat-layout {
  min-height: auto !important;
  height: auto !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.chat-header {
  display: none !important;
}

.chat-body {
  min-height: 310px !important;
  background: transparent !important;
}

.chat-messages-list {
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 0 170px !important;
  gap: 24px !important;
}

.chat-message {
  position: relative !important;
  overflow: visible !important;
  border-radius: 16px !important;
  line-height: 1.62 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

.chat-message-from-bot {
  width: fit-content !important;
  max-width: min(680px, calc(85% - 44px)) !important;
  margin-left: 44px !important;
  border: 1px solid rgba(15, 130, 245, 0.16) !important;
  border-radius: 16px !important;
  border-top-left-radius: 4px !important;
  background:
    linear-gradient(180deg, #ffffff 0%, #f9fcff 100%) !important;
  color: #1a1c1c !important;
  box-shadow:
    inset 3px 0 0 rgba(15, 130, 245, 0.56),
	    0 8px 24px rgba(15, 130, 245, 0.07) !important;
}

.chat-message-from-bot::before {
  position: absolute;
  top: 0;
  left: -44px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(89, 214, 253, 0.48);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(89, 214, 253, 0.32)),
    #ffffff;
  box-shadow:
    0 8px 18px rgba(15, 130, 245, 0.18),
    0 0 0 3px rgba(15, 130, 245, 0.08),
    inset 0 0 0 3px rgba(89, 214, 253, 0.16);
  color: #0f82f5;
  content: "IQ";
  font: 800 11px/1 Poppins, Verdana, sans-serif;
  letter-spacing: 0;
}

.chat-message-from-user {
  width: fit-content !important;
  max-width: min(680px, calc(85% - 44px)) !important;
  margin-right: 44px !important;
  margin-left: auto !important;
  border: 0 !important;
  border-radius: 16px !important;
  border-top-right-radius: 4px !important;
  background: linear-gradient(135deg, #0b68c5 0%, #5143d5 100%) !important;
  color: #ffffff !important;
  box-shadow:
    0 2px 8px rgba(15, 130, 245, 0.2),
	    0 8px 24px rgba(15, 130, 245, 0.1) !important;
}

.chat-message-from-user::after {
  position: absolute;
  top: 0;
  right: -44px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(89, 214, 253, 0.42);
  border-radius: 50%;
  background: linear-gradient(135deg, #803584 0%, #5143d5 100%);
  box-shadow:
    0 8px 18px rgba(81, 67, 213, 0.22),
    0 0 0 3px rgba(81, 67, 213, 0.08),
    inset 0 0 0 3px rgba(255, 255, 255, 0.12);
  color: #ffffff;
  content: "YOU";
  font: 800 8px/1 Poppins, Verdana, sans-serif;
  letter-spacing: 0;
}

.chat-message-from-user .chat-message-markdown,
.chat-message-from-user p,
.chat-message-from-user li,
.chat-message-from-user a,
.chat-message-from-user code {
  color: #ffffff !important;
}

.chat-message-from-user a {
  text-decoration-color: rgba(255, 255, 255, 0.86) !important;
}

.chat-message-markdown {
  color: #1a1c1c !important;
  font-size: 14px !important;
  font-weight: 300 !important;
  line-height: 1.62 !important;
}

.chat-message-markdown > *:first-child {
  margin-top: 0 !important;
}

.chat-message-markdown > *:last-child {
  margin-bottom: 0 !important;
}

.chat-message-markdown p {
  margin: 0 0 0.78rem !important;
}

.chat-message-markdown h1,
.chat-message-markdown h2,
.chat-message-markdown h3,
.chat-message-markdown h4 {
  margin: 1.1rem 0 0.55rem !important;
  color: #000000 !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
}

.chat-message-markdown h1 {
  font-size: 1.28rem !important;
}

.chat-message-markdown h2 {
  font-size: 1.14rem !important;
}

.chat-message-markdown h3,
.chat-message-markdown h4 {
  font-size: 1rem !important;
}

.chat-message-markdown ul,
.chat-message-markdown ol {
  margin: 0.45rem 0 0.9rem !important;
  padding-left: 1.55rem !important;
  list-style-position: outside !important;
}

.chat-message-markdown ul {
  list-style-type: disc !important;
}

.chat-message-markdown ul ul {
  list-style-type: circle !important;
}

.chat-message-markdown ul ul ul {
  list-style-type: square !important;
}

.chat-message-markdown ol {
  list-style-type: decimal !important;
}

.chat-message-markdown li {
  display: list-item !important;
  margin: 0.36rem 0 !important;
  padding-left: 0.18rem !important;
}

.chat-message-markdown li::marker {
  color: #803584;
  font-weight: 700;
}

.chat-message-from-user .chat-message-markdown li::marker {
  color: rgba(255, 255, 255, 0.92);
}

.chat-message-markdown li > p {
  margin: 0.16rem 0 !important;
}

.chat-message-markdown li > ul,
.chat-message-markdown li > ol {
  margin-top: 0.35rem !important;
  margin-bottom: 0.45rem !important;
}

.chat-message-markdown blockquote {
  margin: 0.85rem 0 !important;
  padding: 0.72rem 0.95rem !important;
  border-left: 4px solid #803584 !important;
  border-radius: 0 8px 8px 0 !important;
  background: linear-gradient(90deg, rgba(128, 53, 132, 0.1), rgba(89, 214, 253, 0.08)) !important;
  color: #1d1e29 !important;
}

.chat-message-markdown a {
  color: #0b68c5 !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  text-decoration-thickness: 0.08em !important;
  text-underline-offset: 0.18em !important;
}

.chat-message-markdown code {
  border: 1px solid rgba(29, 30, 41, 0.1) !important;
  border-radius: 5px !important;
  background: #f2f6fb !important;
  color: #803584 !important;
  padding: 0.12rem 0.32rem !important;
  font-size: 0.92em !important;
  font-weight: 400 !important;
}

.chat-message-markdown pre {
  overflow-x: auto !important;
  margin: 0.9rem 0 !important;
  padding: 0.95rem 1rem !important;
  border: 1px solid rgba(29, 30, 41, 0.12) !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
  box-shadow: inset 4px 0 0 rgba(15, 130, 245, 0.55) !important;
}

.chat-message-markdown pre code {
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  color: #1d1e29 !important;
}

.chat-message-markdown table {
  width: 100% !important;
  margin: 0.9rem 0 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(29, 30, 41, 0.1) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
}

.chat-message-markdown th,
.chat-message-markdown td {
  padding: 0.62rem 0.72rem !important;
  border-bottom: 1px solid rgba(29, 30, 41, 0.08) !important;
  text-align: left !important;
  vertical-align: top !important;
}

.chat-message-markdown th {
  background: linear-gradient(90deg, rgba(15, 130, 245, 0.12), rgba(89, 214, 253, 0.12)) !important;
  color: #090909 !important;
  font-weight: 700 !important;
}

.chat-message-markdown tr:last-child td {
  border-bottom: 0 !important;
}

.chat-footer {
  position: fixed !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 35 !important;
  padding: 12px 16px 44px !important;
  border-top: 0 !important;
  background: linear-gradient(to top, #fdfdfd 0%, rgba(253, 253, 253, 0.92) 62%, rgba(253, 253, 253, 0) 100%) !important;
  box-shadow: none !important;
}

.chat-input {
  width: min(800px, 100%) !important;
  min-height: 52px !important;
  margin: 0 auto !important;
  padding: 7px 8px !important;
  align-items: center !important;
  border: 1px solid rgba(15, 130, 245, 0.28) !important;
  border-radius: 12px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86)),
    linear-gradient(90deg, rgba(89, 214, 253, 0.12), rgba(128, 53, 132, 0.08)) !important;
  box-shadow:
    0 10px 32px rgba(29, 30, 41, 0.12),
    inset 0 1px 0 rgba(89, 214, 253, 0.24) !important;
  backdrop-filter: blur(12px);
  transition:
    border-color 180ms ease,
	    box-shadow 180ms ease;
}

.chat-inputs {
  background: transparent !important;
  color: #1a1c1c !important;
}

.chat-input:focus-within {
  border-color: #59d6fd !important;
  box-shadow:
    0 0 0 2px rgba(15, 130, 245, 0.74),
    0 8px 30px rgba(15, 130, 245, 0.13),
    0 0 28px rgba(128, 53, 132, 0.12) !important;
}

.chat-input textarea,
.chat-input input {
  min-height: 36px !important;
  height: 36px !important;
  padding: 7px 12px !important;
  border: 0 !important;
  background: transparent !important;
  max-height: 200px !important;
  color: #1a1c1c !important;
  caret-color: #0f82f5 !important;
  font-size: 14px !important;
  font-weight: 300 !important;
  line-height: 1.6 !important;
  overflow-y: hidden !important;
}

.chat-input textarea::placeholder,
.chat-input input::placeholder {
  color: rgba(68, 71, 72, 0.75) !important;
}

.chat-input textarea:focus,
.chat-input input:focus {
  outline: none !important;
}

.chat-input-send-button,
.chat-input button[type="submit"] {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  margin: 0 4px 0 8px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #0b68c5 0%, #5143d5 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(15, 130, 245, 0.18) !important;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.chat-input-send-button svg,
.chat-input button[type="submit"] svg {
  width: 20px !important;
  height: 20px !important;
}

.chat-input-send-button:hover,
.chat-input button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 130, 245, 0.22) !important;
}

.chat-input-send-button:disabled,
.chat-input button[type="submit"]:disabled {
  opacity: 0.42 !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-theme="dark"] body {
  background: #090909;
  color: #fdfdfd;
}

html[data-theme="dark"] .preview-shell {
  background-color: #090909;
  background-image:
    linear-gradient(180deg, rgba(15, 130, 245, 0.16) 0%, rgba(9, 9, 9, 0) 230px),
    linear-gradient(135deg, rgba(128, 53, 132, 0.11) 0%, rgba(9, 9, 9, 0) 46%),
    linear-gradient(rgba(89, 214, 253, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(89, 214, 253, 0.07) 1px, transparent 1px);
  background-size: auto, auto, 40px 40px, 40px 40px;
}

html[data-theme="dark"] .isometric-shape {
  opacity: 0.22;
}

html[data-theme="dark"] .isometric-shape path:first-child {
  fill: rgba(15, 130, 245, 0.08);
  stroke: #59d6fd;
}

html[data-theme="dark"] .isometric-shape path + path {
  stroke: rgba(89, 214, 253, 0.7);
}

html[data-theme="dark"] .isometric-shape-bottom path:first-child {
  fill: rgba(128, 53, 132, 0.16);
  stroke: #803584;
}

html[data-theme="dark"] .app-topbar {
  border-bottom-color: rgba(89, 214, 253, 0.14);
  background: rgba(9, 9, 9, 0.78);
  box-shadow: 0 1px 16px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .app-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: auto;
  min-width: 150px;
  height: 54px;
  padding: 0;
  border: 0;
  background-image: none;
  box-shadow: none;
}

html[data-theme="dark"] .app-logo::before {
  color: #ffffff;
  content: "Light";
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

html[data-theme="dark"] .app-logo::after {
  color: #59d6fd;
  content: "IQ";
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

html[data-theme="dark"] .theme-toggle {
  border-color: rgba(89, 214, 253, 0.28);
  background: rgba(29, 30, 41, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .theme-toggle-track {
  background: linear-gradient(135deg, rgba(15, 130, 245, 0.34), rgba(128, 53, 132, 0.38));
}

html[data-theme="dark"] .theme-toggle-icon-sun {
  color: #fbc546;
  opacity: 0.58;
}

html[data-theme="dark"] .theme-toggle-icon-moon {
  color: #090909;
  opacity: 1;
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(36px);
  background: #59d6fd;
  box-shadow:
    -5px 0 0 0 rgba(9, 9, 9, 0.72) inset,
    0 0 0 4px rgba(89, 214, 253, 0.14),
    0 3px 10px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .welcome-panel h1 {
  background: linear-gradient(90deg, #ffffff 0%, #59d6fd 54%, #b35bb8 100%);
  color: #ffffff;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[data-theme="dark"] .welcome-panel p {
  color: rgba(253, 253, 253, 0.72);
}

html[data-theme="dark"] .prompt-chip {
  --chip-bg: rgba(89, 214, 253, 0.1);
  border-color: rgba(89, 214, 253, 0.3);
  background:
    linear-gradient(180deg, rgba(29, 30, 41, 0.9), rgba(29, 30, 41, 0.74)),
    var(--chip-bg);
  color: rgba(253, 253, 253, 0.76);
  box-shadow: inset 0 -2px 0 rgba(89, 214, 253, 0.12);
}

html[data-theme="dark"] .prompt-chip:nth-child(2) {
  --chip-bg: rgba(128, 53, 132, 0.16);
  border-color: rgba(128, 53, 132, 0.42);
  box-shadow: inset 0 -2px 0 rgba(128, 53, 132, 0.16);
}

html[data-theme="dark"] .prompt-chip:nth-child(3) {
  --chip-bg: rgba(81, 67, 213, 0.16);
  border-color: rgba(81, 67, 213, 0.42);
  box-shadow: inset 0 -2px 0 rgba(81, 67, 213, 0.16);
}

html[data-theme="dark"] .prompt-chip:hover,
html[data-theme="dark"] .prompt-chip:focus-visible {
  border-color: var(--chip-accent);
  background:
    linear-gradient(180deg, rgba(29, 30, 41, 0.98), rgba(29, 30, 41, 0.82)),
    var(--chip-bg);
  color: var(--chip-accent);
}

html[data-theme="dark"] .chat-message {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] .chat-message-from-bot {
  border-color: rgba(89, 214, 253, 0.16) !important;
  background:
    linear-gradient(180deg, rgba(29, 30, 41, 0.97), rgba(20, 22, 34, 0.97)) !important;
  color: #fdfdfd !important;
  box-shadow:
    inset 3px 0 0 rgba(89, 214, 253, 0.6),
    0 10px 28px rgba(0, 0, 0, 0.24),
	    0 0 0 1px rgba(128, 53, 132, 0.08) !important;
}

html[data-theme="dark"] .chat-message-from-bot::before {
  border-color: rgba(89, 214, 253, 0.6);
  background:
    linear-gradient(135deg, rgba(29, 30, 41, 0.98), rgba(15, 130, 245, 0.46)),
    #1d1e29;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.28),
    0 0 0 3px rgba(89, 214, 253, 0.12);
  color: #59d6fd;
}

html[data-theme="dark"] .chat-message-from-user::after {
  border-color: rgba(89, 214, 253, 0.5);
  background: linear-gradient(135deg, #0f82f5 0%, #803584 100%);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.28),
    0 0 0 3px rgba(89, 214, 253, 0.12);
}

html[data-theme="dark"] .chat-message-markdown,
html[data-theme="dark"] .chat-message-from-bot p,
html[data-theme="dark"] .chat-message-from-bot li {
  color: rgba(253, 253, 253, 0.88) !important;
}

html[data-theme="dark"] .chat-message-markdown h1,
html[data-theme="dark"] .chat-message-markdown h2,
html[data-theme="dark"] .chat-message-markdown h3,
html[data-theme="dark"] .chat-message-markdown h4 {
  color: #ffffff !important;
}

html[data-theme="dark"] .chat-message-markdown li::marker {
  color: #59d6fd;
}

html[data-theme="dark"] .chat-message-markdown blockquote {
  border-left-color: #803584 !important;
  background: linear-gradient(90deg, rgba(128, 53, 132, 0.18), rgba(89, 214, 253, 0.1)) !important;
  color: rgba(253, 253, 253, 0.9) !important;
}

html[data-theme="dark"] .chat-message-markdown a {
  color: #59d6fd !important;
}

html[data-theme="dark"] .chat-message-markdown code {
  border-color: rgba(89, 214, 253, 0.18) !important;
  background: rgba(9, 9, 9, 0.52) !important;
  color: #fbc546 !important;
}

html[data-theme="dark"] .chat-message-markdown pre {
  border-color: rgba(89, 214, 253, 0.16) !important;
  background: #10111a !important;
  box-shadow: inset 4px 0 0 rgba(89, 214, 253, 0.6) !important;
}

html[data-theme="dark"] .chat-message-markdown pre code {
  color: rgba(253, 253, 253, 0.9) !important;
}

html[data-theme="dark"] .chat-message-markdown table {
  border-color: rgba(89, 214, 253, 0.16) !important;
  background: #10111a !important;
}

html[data-theme="dark"] .chat-message-markdown th,
html[data-theme="dark"] .chat-message-markdown td {
  border-bottom-color: rgba(89, 214, 253, 0.12) !important;
}

html[data-theme="dark"] .chat-message-markdown th {
  background: linear-gradient(90deg, rgba(15, 130, 245, 0.24), rgba(128, 53, 132, 0.18)) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .chat-footer {
  background: linear-gradient(to top, #090909 0%, rgba(9, 9, 9, 0.94) 62%, rgba(9, 9, 9, 0) 100%) !important;
}

html[data-theme="dark"] .chat-input {
  border-color: rgba(89, 214, 253, 0.24) !important;
  background:
    linear-gradient(180deg, rgba(29, 30, 41, 0.94), rgba(20, 22, 34, 0.94)),
    linear-gradient(90deg, rgba(89, 214, 253, 0.2), rgba(128, 53, 132, 0.18)) !important;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(89, 214, 253, 0.16) !important;
}

html[data-theme="dark"] .chat-input:focus-within {
  border-color: #59d6fd !important;
  box-shadow:
    0 0 0 2px rgba(89, 214, 253, 0.86),
    0 12px 34px rgba(15, 130, 245, 0.18) !important;
}

html[data-theme="dark"] .chat-input textarea,
html[data-theme="dark"] .chat-inputs,
html[data-theme="dark"] .chat-input input {
  color: #fdfdfd !important;
  caret-color: #59d6fd !important;
  background: transparent !important;
}

html[data-theme="dark"] .chat-input textarea::placeholder,
html[data-theme="dark"] .chat-input input::placeholder {
  color: rgba(253, 253, 253, 0.56) !important;
}

html[data-theme="dark"] .preview-status {
  border-color: rgba(89, 214, 253, 0.18);
  background: #1d1e29;
  color: #fdfdfd;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .ai-disclaimer {
  color: rgba(253, 253, 253, 0.66) !important;
}

html[data-theme="dark"] .ai-disclaimer::before {
  background: linear-gradient(135deg, #59d6fd, #803584);
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-toggle-thumb {
    transition: none;
  }
}

@media (max-width: 760px) {
  .preview-shell {
    padding: 78px 16px 124px;
  }

  .theme-toggle {
    right: 12px;
  }

  .ai-disclaimer {
    bottom: 8px !important;
    font-size: 10.5px !important;
  }

  .app-logo {
    width: 132px;
    height: 48px;
  }

  html[data-theme="dark"] .app-logo {
    min-width: 132px;
    height: 48px;
  }

  html[data-theme="dark"] .app-logo::before,
  html[data-theme="dark"] .app-logo::after {
    font-size: 27px;
  }

  .welcome-panel {
    padding-top: 26px;
  }

  .prompt-chip {
    max-width: 100%;
  }

  .chat-message-from-bot,
  .chat-message-from-user {
    max-width: calc(100% - 42px) !important;
  }

  .chat-message-from-bot {
    margin-left: 38px !important;
  }

  .chat-message-from-user {
    margin-right: 38px !important;
  }

  .chat-message-from-bot::before {
    left: -38px;
    width: 28px;
    height: 28px;
    font-size: 10px;
  }

  .chat-message-from-user::after {
    right: -38px;
    width: 28px;
    height: 28px;
  }

  .chat-message {
    padding: 14px 16px !important;
  }

  .chat-message-markdown ul,
  .chat-message-markdown ol {
    padding-left: 1.38rem !important;
  }

  .isometric-shape {
    opacity: 0.08;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
