:root {
  --bg: #ffffff;
  --bg-sidebar: #f7f7f8;
  --bg-hover: #ececf1;
  --bg-msg-user: #f4f4f5;
  --bg-msg-ai: transparent;
  --text: #0f0f0f;
  --text-muted: #6b6b76;
  --text-faint: #9a9aa3;
  --border: #e8e8ec;
  --orange: #ff5a1f;
  --orange-hover: #e64e17;
  --orange-soft: rgba(255, 90, 31, 0.12);
  --composer-bg: #ffffff;
  --composer-shadow: 0 2px 16px rgba(15, 15, 15, 0.08), 0 0 0 1px rgba(15, 15, 15, 0.06);
  --radius-pill: 999px;
  --sidebar-w: 268px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --app-h: 100dvh;
  --app-offset-top: 0px;
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --bg: #121214;
  --bg-sidebar: #1a1a1e;
  --bg-hover: #2a2a30;
  --bg-msg-user: #2a2a30;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-faint: #71717a;
  --border: #2e2e34;
  --composer-bg: #1e1e24;
  --composer-shadow: 0 2px 20px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

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

html,
body {
  height: 100%;
  height: 100dvh;
  margin: 0;
  touch-action: manipulation;
  -ms-touch-action: manipulation;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app,
.app * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.app input,
.app textarea,
.app [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

button,
input {
  font-family: inherit;
}

button,
.icon-btn,
.composer-mic,
.composer-send {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  outline: none;
}

button::-moz-focus-inner {
  border: 0;
}

button:focus,
button:focus-visible,
button:active,
.icon-btn:focus,
.icon-btn:focus-visible,
.composer-mic:focus,
.composer-mic:focus-visible,
.composer-send:focus,
.composer-send:focus-visible {
  outline: none;
  box-shadow: none;
}

button svg,
.composer-mic svg,
.composer-send svg {
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.app {
  display: flex;
  height: 100%;
  height: var(--app-h, 100dvh);
  max-height: var(--app-h, 100dvh);
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background:
    linear-gradient(180deg, rgba(255, 90, 31, 0.06) 0%, transparent 140px),
    var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px 12px;
  z-index: 40;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: inset -1px 0 0 transparent;
}

html[data-theme="dark"] .sidebar {
  background:
    linear-gradient(180deg, rgba(255, 90, 31, 0.1) 0%, transparent 160px),
    var(--bg-sidebar);
}

.sidebar-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 4px 6px;
  margin-bottom: 4px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
}

.sidebar-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--orange) 0%, #ff7a45 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.03em;
  box-shadow: 0 6px 14px rgba(255, 90, 31, 0.28);
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.btn-new-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 12px;
  background: var(--orange);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255, 90, 31, 0.28);
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.btn-new-chat:hover {
  background: var(--orange-hover);
  box-shadow: 0 10px 22px rgba(255, 90, 31, 0.34);
}

.btn-new-chat:active {
  transform: scale(0.98);
}

.sidebar-section-label {
  margin-top: 18px;
  margin-bottom: 8px;
  padding: 0 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.chat-list-empty {
  margin: 4px 6px;
  padding: 14px 12px;
  font-size: 0.84rem;
  color: var(--text-faint);
  background: rgba(15, 15, 15, 0.03);
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
}

html[data-theme="dark"] .chat-list-empty {
  background: rgba(255, 255, 255, 0.03);
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 6px 6px 10px;
  border-radius: 11px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}

.chat-item:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.chat-item.active {
  background: var(--orange-soft);
  border-color: rgba(255, 90, 31, 0.22);
  color: var(--text);
  font-weight: 600;
}

.chat-item-open,
.chat-item-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  padding: 6px 4px;
  cursor: pointer;
}

.chat-item-del {
  flex-shrink: 0;
  opacity: 0;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}

.chat-item:hover .chat-item-del,
.chat-item.active .chat-item-del {
  opacity: 1;
}

.chat-item-del:hover,
.chat-item-del:focus-visible {
  color: #c0392b;
  background: rgba(192, 57, 43, 0.08);
  opacity: 1;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(2px);
  z-index: 35;
}

/* Main */
.main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  flex-shrink: 0;
  position: relative;
  z-index: 50;
  background: var(--bg);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.model-switch {
  position: relative;
  margin-right: 2px;
}

.model-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.model-switch-btn:hover,
.model-switch.open .model-switch-btn {
  background: var(--bg-hover);
  border-color: var(--text-faint);
}

.model-switch-label {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  padding: 6px;
  border-radius: 12px;
  background: var(--composer-bg);
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(15, 15, 15, 0.12);
  z-index: 40;
}

.model-option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.model-option:hover {
  background: var(--bg-hover);
}

.model-option.active {
  background: var(--orange-soft);
  color: var(--orange);
  font-weight: 650;
}

.icon-btn {
  position: relative;
  z-index: 30;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.12s ease, color 0.12s ease;
}

#btnMenu {
  z-index: 60;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.icon-sun {
  display: none;
}

html[data-theme="dark"] .icon-moon {
  display: none;
}

html[data-theme="dark"] .icon-sun {
  display: block;
}

.chat-stage {
  flex: 1;
  min-height: 0;
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

.welcome {
  margin: auto;
  text-align: center;
  padding: 16px 12px 48px;
  max-width: 640px;
  width: 100%;
  animation: fadeUp 0.45s ease both;
}

.welcome h1 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 4.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.welcome p {
  margin: 0 0 20px;
  font-size: clamp(0.9rem, 2.3vw, 1.02rem);
  color: var(--text-muted);
  line-height: 1.5;
}

.welcome-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 20px;
  text-align: left;
}

.welcome-product {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 90, 31, 0.06) 0%, transparent 55%),
    var(--bg);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  animation: fadeUp 0.45s ease both;
}

.welcome-product:nth-child(1) { animation-delay: 0.05s; }
.welcome-product:nth-child(2) { animation-delay: 0.1s; }
.welcome-product:nth-child(3) { animation-delay: 0.15s; }
.welcome-product:nth-child(4) { animation-delay: 0.2s; }

.welcome-product:hover {
  border-color: rgba(255, 90, 31, 0.45);
  transform: translateY(-2px);
  background:
    linear-gradient(145deg, rgba(255, 90, 31, 0.1) 0%, transparent 55%),
    var(--bg-hover);
}

.welcome-product:active {
  transform: translateY(0);
}

.welcome-product-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--orange-soft);
  color: var(--orange);
}

.welcome-product-svg {
  display: block;
}

.welcome-product-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.welcome-product-title {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.welcome-product-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.welcome-prompts-label {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.welcome-prompts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.welcome-prompt {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  animation: fadeUp 0.4s ease both;
}

.welcome-prompt:nth-child(1) { animation-delay: 0.22s; }
.welcome-prompt:nth-child(2) { animation-delay: 0.27s; }
.welcome-prompt:nth-child(3) { animation-delay: 0.32s; }
.welcome-prompt:nth-child(4) { animation-delay: 0.37s; }
.welcome-prompt:nth-child(5) { animation-delay: 0.42s; }

.welcome-prompt:hover {
  border-color: rgba(255, 90, 31, 0.5);
  background: var(--orange-soft);
  color: var(--orange-hover);
  transform: translateY(-1px);
}

.welcome-prompt:active {
  transform: translateY(0);
}

html[data-theme="dark"] .welcome-product,
html[data-theme="dark"] .welcome-prompt {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .welcome-product:hover {
  background:
    linear-gradient(145deg, rgba(255, 90, 31, 0.14) 0%, transparent 55%),
    var(--bg-hover);
}

.messages {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeUp 0.3s ease both;
}

.reply-spacer {
  flex-shrink: 0;
  width: 100%;
  height: 0;
  pointer-events: none;
}

.msg-role {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.msg.user .msg-bubble {
  align-self: flex-end;
  background: var(--bg-msg-user);
  border-radius: 18px 18px 6px 18px;
  padding: 12px 16px;
  max-width: min(92%, 560px);
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.assistant .msg-bubble {
  align-self: flex-start;
  background: var(--bg-msg-ai);
  padding: 2px 0;
  max-width: 100%;
  font-size: 0.98rem;
  line-height: 1.6;
  word-break: break-word;
}

.msg.assistant .msg-role {
  color: var(--orange);
}

.msg.assistant .msg-text {
  margin-bottom: 14px;
  color: var(--text);
  line-height: 1.55;
}

.msg-text-after {
  margin-top: 14px;
  margin-bottom: 0;
  padding-top: 2px;
}

.msg.assistant .msg-text + .wf-slider,
.msg.assistant .msg-text + .wf-picks,
.msg.assistant .msg-text + .wf-grid {
  margin-top: 2px;
}

/* Compact featured picks (name + small thumb) above slider */
.wf-picks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px;
  width: 100%;
}

.wf-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-sidebar);
  min-width: 0;
}

.wf-pick-img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-hover);
}

.wf-pick-img-ph {
  background: linear-gradient(135deg, var(--bg-hover), var(--border));
}

.wf-pick-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wf-pick-name {
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wf-pick-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.86rem;
}

.wf-pick-price .wf-price-now {
  font-weight: 700;
  color: var(--orange);
}

.wf-pick-price .wf-price-mrp {
  font-size: 0.78rem;
  color: var(--text-faint);
  text-decoration: line-through;
}

.msg.typing .msg-bubble {
  display: inline-flex;
  gap: 5px;
  padding: 10px 4px;
}

.msg.is-streaming .caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--orange);
  animation: caretBlink 0.9s step-end infinite;
}

.msg-ui-fade {
  animation: fadeUp 0.35s ease;
}

@keyframes caretBlink {
  50% {
    opacity: 0;
  }
}

/* Rich cards */
.wf-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
}

/* Product horizontal slider — fixed card width so 1–N items look balanced */
.wf-slider {
  position: relative;
  width: 100%;
  margin: 8px 0 4px;
  --wf-slider-pad: 8px;
}

.wf-slider.is-scrollable {
  --wf-slider-pad: 36px;
}

.wf-slider-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 4px var(--wf-slider-pad) 12px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--orange) 55%, transparent) transparent;
}

.wf-slider-track::-webkit-scrollbar {
  height: 5px;
}

.wf-slider-track::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--orange) 55%, transparent);
  border-radius: 999px;
}

.wf-slider-item {
  flex: 0 0 196px;
  width: 196px;
  max-width: calc(100% - 24px);
  min-width: 0;
  scroll-snap-align: start;
}

.wf-slider-item .wf-product {
  height: 100%;
}

.wf-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(15, 15, 15, 0.1);
  display: grid;
  place-items: center;
  opacity: 1;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, visibility 0.15s ease;
}

.wf-slider-btn:hover {
  background: var(--bg-hover);
  border-color: color-mix(in srgb, var(--orange) 45%, var(--border));
}

.wf-slider-btn:disabled,
.wf-slider-btn.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.wf-slider-btn.prev {
  left: 2px;
}

.wf-slider-btn.next {
  right: 2px;
}

@media (max-width: 640px) {
  .wf-slider {
    --wf-slider-gap: 8px;
  }

  .wf-slider.is-scrollable {
    --wf-slider-pad: 28px;
  }

  .wf-slider-track {
    gap: var(--wf-slider-gap, 8px);
  }

  .wf-slider-item {
    flex: 0 0 calc((100% - (var(--wf-slider-gap, 8px) * 2)) / 3);
    width: calc((100% - (var(--wf-slider-gap, 8px) * 2)) / 3);
    max-width: none;
  }

  .wf-slider-item .wf-product {
    border-radius: 10px;
  }

  .wf-slider-item .wf-product-body {
    padding: 6px 7px 8px;
    gap: 3px;
  }

  .wf-slider-item .wf-product .wf-card-title {
    font-size: 0.68rem;
    min-height: 2.3em;
    line-height: 1.25;
  }

  .wf-slider-item .wf-card-sub {
    font-size: 0.62rem;
  }

  .wf-slider-item .wf-price-now {
    font-size: 0.82rem;
  }

  .wf-slider-item .wf-price-mrp {
    font-size: 0.62rem;
  }

  .wf-slider-item .wf-price-off {
    font-size: 0.58rem;
  }

  .wf-slider-item .wf-product .wf-specs {
    display: none;
  }

  .wf-slider-btn {
    width: 26px;
    height: 26px;
    font-size: 1.05rem;
  }
}

.wf-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.wf-card-link:hover .wf-card,
.wf-card-link:hover .wf-pick,
.wf-card-link:focus-visible .wf-card {
  border-color: color-mix(in srgb, var(--orange) 35%, var(--border));
}

.wf-card-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--orange) 55%, transparent);
  outline-offset: 2px;
  border-radius: 14px;
}

.wf-slider-item .wf-card-link {
  height: 100%;
}

.wf-slider-item .wf-card-link .wf-product {
  height: 100%;
}

.wf-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.wf-card:hover {
  border-color: color-mix(in srgb, var(--orange) 40%, var(--border));
  box-shadow: 0 8px 24px rgba(15, 15, 15, 0.06);
}

.wf-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.wf-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 2px;
}

.wf-card-title {
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.35;
}

.wf-card-sub {
  margin-top: 3px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.wf-card-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--orange);
  white-space: nowrap;
}

.wf-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.wf-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
}

.wf-card-line {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge-ok {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.badge-warn {
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
}

.badge-bad {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.badge-neutral {
  background: var(--bg-hover);
  color: var(--text-muted);
}

html[data-theme="dark"] .badge-ok {
  color: #4ade80;
}
html[data-theme="dark"] .badge-warn {
  color: #fb923c;
}
html[data-theme="dark"] .badge-bad {
  color: #f87171;
}

/* Product cards — compact image + price / color / size */
.wf-product {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  border-color: color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 14px;
  box-shadow: none;
}

.wf-product:hover {
  border-color: var(--border);
  box-shadow: 0 4px 14px rgba(15, 15, 15, 0.04);
  transform: none;
}

.wf-product-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  max-height: none;
  background: var(--bg-sidebar);
  overflow: hidden;
  border-radius: 0;
}

.wf-product-img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.25s ease;
}

.wf-product:hover .wf-product-img {
  transform: scale(1.04);
}

.wf-thumb-ph {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--bg-hover), var(--border) 55%, var(--bg-sidebar));
}

.wf-product-media.is-broken .wf-thumb-fallback,
.wf-product-media:not(:has(img)) .wf-thumb-fallback {
  display: block;
}

.wf-thumb-fallback {
  display: none;
}

.wf-product-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 12px;
  gap: 6px;
}

.wf-product .wf-card-title {
  font-size: 0.84rem;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
  line-height: 1.35;
  word-break: break-word;
}

.wf-price-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-top: 2px;
}

.wf-price-now {
  font-size: 1rem;
  font-weight: 800;
  color: var(--orange);
  letter-spacing: -0.02em;
}

.wf-price-mrp {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-faint);
  text-decoration: line-through;
}

.wf-price-off {
  font-size: 0.72rem;
  font-weight: 750;
  color: #15803d;
  white-space: nowrap;
}

html[data-theme="dark"] .wf-price-off {
  color: #4ade80;
}

.wf-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.wf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wf-chip b {
  color: var(--text);
  font-weight: 750;
}

/* Filters — Filters | Color : Black, Tan | Size : 7, 8 | … */
.wf-feat-panel {
  margin: 6px 0 2px;
  padding: 0;
  border: none;
  background: transparent;
}

.wf-feat-title {
  font-size: inherit;
  font-weight: 650;
  color: var(--text-muted);
}

.wf-feat-row {
  display: block;
  font-size: 0.72rem;
  color: var(--text);
  line-height: 1.5;
}

.wf-feat-group {
  display: inline;
  white-space: normal;
}

.wf-feat-k {
  color: var(--text-muted);
  font-weight: 600;
}

.wf-feat-sep {
  display: inline-block;
  margin: 0 8px;
  color: var(--text-muted);
  opacity: 0.55;
  font-weight: 400;
  user-select: none;
}

.wf-feat-comma {
  color: var(--text-muted);
}

.wf-feat-chip {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 0;
  padding: 0;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  line-height: inherit;
  white-space: nowrap;
}

.wf-feat-chip:hover,
.wf-feat-chip.is-active {
  color: var(--orange);
}

.wf-rating {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}

.wf-star {
  color: #f59e0b;
}

.wf-order-left {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.wf-order {
  padding: 12px 14px;
  background: var(--bg);
  border-color: var(--border);
  border-radius: 12px;
  box-shadow: none;
}

.wf-order:hover {
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

.wf-order-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.wf-order-img-wrap {
  width: 64px;
  height: 64px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-hover);
  border: 1px solid var(--border);
}

.wf-order-img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  display: block;
}

.wf-order-img-ph {
  background: linear-gradient(135deg, var(--bg-hover), var(--border));
}

.wf-order-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wf-order-id {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.wf-order-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wf-order-price {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--text);
  margin-top: 2px;
  letter-spacing: -0.01em;
}

.wf-order-date {
  font-size: 0.76rem;
  color: var(--text-faint);
  font-weight: 500;
  margin-top: 2px;
}

.wf-order .wf-card-meta {
  margin-top: 6px;
  gap: 6px;
}

/* Quiet status labels on order cards */
.wf-order .badge {
  padding: 2px 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.wf-order .badge + .badge::before {
  content: "·";
  margin-right: 6px;
  color: var(--text-faint);
  font-weight: 500;
}

.wf-order .badge-ok {
  color: #3f7a4f;
  background: transparent;
}

.wf-order .badge-warn {
  color: #8a6a3a;
  background: transparent;
}

.wf-order .badge-bad {
  color: #8b4a4a;
  background: transparent;
}

.wf-order .badge-neutral {
  color: var(--text-muted);
  background: transparent;
}

html[data-theme="dark"] .wf-order .badge-ok {
  color: #7cbc8f;
}
html[data-theme="dark"] .wf-order .badge-warn {
  color: #c4a574;
}
html[data-theme="dark"] .wf-order .badge-bad {
  color: #c48a8a;
}

.wf-order-full {
  padding: 14px;
  background: var(--bg);
  border-radius: 12px;
}

.wf-order-full:hover {
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

.wf-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.wf-section:first-child {
  padding-top: 0;
}

.wf-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.wf-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.wf-kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.wf-kv strong {
  color: var(--text);
  font-weight: 700;
  text-align: right;
}

.wf-kv.is-total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 0.95rem;
}

.wf-kv.is-total strong {
  color: var(--orange);
  font-weight: 800;
}

.wf-order-product {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.wf-order-product-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wf-order-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 600;
}

.wf-order-product-meta strong {
  color: var(--orange);
  font-weight: 800;
  margin-left: auto;
}

.wf-addr-name {
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--text);
  margin-bottom: 4px;
}

/* Tracking timeline */
.wf-track {
  margin-top: 4px;
  padding-top: 4px;
}

.wf-track-title {
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--text);
  margin-bottom: 10px;
}

.wf-track-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
  position: relative;
}

.wf-track-step {
  display: flex;
  gap: 10px;
  position: relative;
  padding-bottom: 14px;
}

.wf-track-step:last-child {
  padding-bottom: 0;
}

.wf-track-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.wf-track-step.is-done:not(:last-child)::before {
  background: color-mix(in srgb, var(--orange) 55%, var(--border));
}

.wf-track-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  margin-top: 2px;
  z-index: 1;
}

.wf-track-step.is-done .wf-track-dot {
  border-color: var(--orange);
  background: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}

.wf-track-name {
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--text-muted);
}

.wf-track-step.is-done .wf-track-name {
  color: var(--text);
  font-weight: 750;
}

.wf-track-date {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 2px;
}

.wf-track-reason {
  font-size: 0.72rem;
  color: #b91c1c;
  margin-top: 2px;
}

.wf-profile {
  display: flex;
  gap: 12px;
  align-items: center;
}

.wf-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.wf-summary .wf-sum-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.wf-summary .wf-sum-row:first-of-type {
  margin-top: 8px;
}

.wf-summary .wf-sum-row strong {
  color: var(--text);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: bounce 1.2s infinite ease-in-out;
}

.dot:nth-child(2) {
  animation-delay: 0.15s;
}

.dot:nth-child(3) {
  animation-delay: 0.3s;
}

/* Composer */
.composer-wrap {
  position: relative;
  z-index: 40;
  flex-shrink: 0;
  padding: 8px 16px calc(14px + var(--safe-b));
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  /* Keep taps on Send/Mic — don't let chat content steal them on layout shift */
  touch-action: manipulation;
}

.composer {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--composer-bg);
  border-radius: var(--radius-pill);
  box-shadow: var(--composer-shadow);
  padding: 6px 6px 6px 20px;
  transition: box-shadow 0.15s ease;
}

.composer:focus-within {
  box-shadow: var(--composer-shadow), 0 0 0 3px var(--orange-soft);
}

.composer-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  padding: 12px 4px;
}

.composer-input::placeholder {
  color: var(--text-faint);
  font-weight: 500;
}

.composer-mic {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  overflow: visible;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.composer-mic:hover {
  color: var(--orange);
  background: var(--orange-soft);
}

.composer-mic .mic-icon,
.composer-mic .mic-waves {
  position: relative;
  z-index: 2;
}

.composer-mic .mic-waves {
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 2.5px;
  height: 16px;
}

.composer-mic .mic-waves i {
  display: block;
  width: 2.5px;
  border-radius: 2px;
  background: currentColor;
  animation: micWave 0.9s ease-in-out infinite;
}

.composer-mic .mic-waves i:nth-child(1) {
  height: 6px;
  animation-delay: 0s;
}

.composer-mic .mic-waves i:nth-child(2) {
  height: 12px;
  animation-delay: 0.15s;
}

.composer-mic .mic-waves i:nth-child(3) {
  height: 8px;
  animation-delay: 0.3s;
}

.composer-mic .mic-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--orange);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.composer-mic.listening {
  color: #fff;
  background: var(--orange);
  box-shadow: 0 0 0 4px var(--orange-soft);
  animation: micBreath 1.4s ease-in-out infinite;
}

.composer-mic.listening .mic-icon {
  display: none;
}

.composer-mic.listening .mic-waves {
  display: inline-flex;
}

.composer-mic.listening .mic-pulse {
  animation: micRing 1.6s ease-out infinite;
}

.composer-mic.listening .mic-pulse--delay {
  animation-delay: 0.55s;
}

.composer.listening-active {
  box-shadow:
    0 2px 16px rgba(255, 90, 31, 0.18),
    0 0 0 1.5px rgba(255, 90, 31, 0.35);
}

@keyframes micRing {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  100% {
    transform: scale(1.85);
    opacity: 0;
  }
}

@keyframes micBreath {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes micWave {
  0%,
  100% {
    transform: scaleY(0.55);
    opacity: 0.7;
  }
  50% {
    transform: scaleY(1.25);
    opacity: 1;
  }
}

.composer-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}

.composer-send:hover {
  background: var(--orange-hover);
}

.composer-send:active {
  transform: scale(0.94);
}

.composer-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.composer-hint {
  margin: 10px 0 0;
  font-size: 0.72rem;
  color: var(--text-faint);
  text-align: center;
  max-width: 90%;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + var(--safe-b));
  transform: translateX(-50%);
  background: #1f1f23;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .toast {
  background: #f4f4f5;
  color: #121214;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* Mobile splash / flash screen — brand orange theme */
.splash-grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 42%, #000 18%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000 18%, transparent 72%);
  pointer-events: none;
  opacity: 0.55;
  animation: splashGridDrift 8s linear infinite;
}

.splash-scan {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 90px;
  top: 18%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 45%,
    rgba(255, 236, 210, 0.14) 55%,
    transparent 100%
  );
  pointer-events: none;
  animation: splashScan 2.4s ease-in-out infinite;
}

.splash-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.splash-particles i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff7ed;
  opacity: 0;
  box-shadow: 0 0 10px rgba(255, 237, 213, 0.9);
  animation: splashFloat 3.6s ease-in-out infinite;
}

.splash-particles i:nth-child(1) { left: 14%; top: 22%; animation-delay: 0s; }
.splash-particles i:nth-child(2) { left: 78%; top: 18%; width: 4px; height: 4px; background: #ffedd5; animation-delay: 0.4s; }
.splash-particles i:nth-child(3) { left: 22%; top: 68%; width: 3px; height: 3px; animation-delay: 0.8s; }
.splash-particles i:nth-child(4) { left: 84%; top: 62%; background: #fed7aa; animation-delay: 1.1s; }
.splash-particles i:nth-child(5) { left: 48%; top: 14%; width: 4px; height: 4px; animation-delay: 0.2s; }
.splash-particles i:nth-child(6) { left: 10%; top: 48%; width: 3px; height: 3px; background: #fff; animation-delay: 1.4s; }
.splash-particles i:nth-child(7) { left: 90%; top: 40%; width: 4px; height: 4px; animation-delay: 0.6s; }
.splash-particles i:nth-child(8) { left: 58%; top: 78%; background: #ffedd5; animation-delay: 1.7s; }

.splash-core {
  position: relative;
  z-index: 1;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  animation:
    splashPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both,
    splashBreath 2.2s ease-in-out 0.55s infinite;
}

.splash-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.splash-ring--a {
  inset: 8px;
  animation: splashSpin 4.5s linear infinite;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.45);
}

.splash-ring--b {
  inset: -6px;
  animation: splashSpinRev 7s linear infinite;
  border-color: rgba(255, 236, 210, 0.5);
  box-shadow: 0 0 18px rgba(255, 90, 31, 0.25);
}

.splash-ring--c {
  inset: 22px;
  border-color: rgba(255, 255, 255, 0.22);
  animation: splashPulseRing 1.8s ease-in-out infinite;
}

.splash-orbit {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  animation: splashSpin 3.2s linear infinite;
  pointer-events: none;
}

.splash-orbit em {
  position: absolute;
  top: 0;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px #fff, 0 0 22px rgba(255, 237, 213, 0.8);
}

.splash-ai-icon {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 122, 69, 0.35) 100%),
    rgba(230, 78, 23, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.1),
    0 16px 36px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  animation: splashGlow 1.8s ease-in-out infinite;
}

.splash-ai-icon svg {
  animation: splashIconPulse 1.6s ease-in-out infinite;
}

.splash-copy {
  position: relative;
  z-index: 1;
  text-align: center;
  animation: splashRise 0.55s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.splash-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
  background: linear-gradient(90deg, #fff 0%, #ffedd5 40%, #fff 70%, #ffe4c4 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: splashShimmer 2.4s linear infinite;
}

.splash-tag {
  margin-top: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.88);
}

.splash-dots b {
  display: inline-block;
  animation: splashDotBlink 1.2s ease-in-out infinite;
  opacity: 0.25;
}

.splash-dots b:nth-child(2) { animation-delay: 0.2s; }
.splash-dots b:nth-child(3) { animation-delay: 0.4s; }

.splash-bar {
  position: relative;
  z-index: 1;
  width: min(180px, 46vw);
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
  margin-top: 4px;
  animation: splashRise 0.55s 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.splash-bar i {
  display: block;
  height: 100%;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fff, #ffedd5, #fff);
  animation: splashBar 1.1s ease-in-out infinite;
}

@keyframes splashPop {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes splashRise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splashSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes splashSpinRev {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes splashBar {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(280%);
  }
}

@keyframes splashBreath {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

@keyframes splashGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 6px rgba(255, 255, 255, 0.1),
      0 16px 36px rgba(0, 0, 0, 0.22);
  }
  50% {
    box-shadow:
      0 0 0 10px rgba(255, 255, 255, 0.18),
      0 0 28px rgba(255, 237, 213, 0.35),
      0 16px 36px rgba(0, 0, 0, 0.22);
  }
}

@keyframes splashIconPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes splashPulseRing {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes splashShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes splashFloat {
  0%,
  100% {
    opacity: 0;
    transform: translateY(8px) scale(0.7);
  }
  20% {
    opacity: 0.9;
  }
  50% {
    opacity: 1;
    transform: translateY(-18px) scale(1);
  }
  80% {
    opacity: 0.55;
  }
}

@keyframes splashScan {
  0% {
    transform: translateY(0);
    opacity: 0.35;
  }
  50% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(52vh);
    opacity: 0.25;
  }
}

@keyframes splashGridDrift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(0, 28px, 0);
  }
}

@keyframes splashDotBlink {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
}

/* Mobile */
@media (max-width: 820px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
    position: fixed;
    inset: 0;
    width: 100%;
  }

  .app {
    position: fixed;
    top: var(--app-offset-top, 0px);
    left: 0;
    right: 0;
    width: 100%;
    height: var(--app-h, 100dvh);
    max-height: var(--app-h, 100dvh);
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: var(--app-h, 100dvh);
    transform: translateX(-105%);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
  }

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

  .sidebar-backdrop.show {
    display: block;
  }

  .main {
    min-height: 0;
    overflow: hidden;
  }

  .topbar {
    position: relative;
    z-index: 50;
    flex-shrink: 0;
    background: var(--bg);
  }

  .chat-stage {
    min-height: 0;
    scroll-padding-top: 12px;
    scroll-padding-bottom: 12px;
  }

  .messages {
    padding-bottom: 16px;
  }

  .composer-wrap {
    padding-bottom: calc(10px + var(--safe-b));
  }

  .welcome {
    padding-bottom: 40px;
  }

  .welcome-products {
    gap: 8px;
    margin-bottom: 22px;
  }

  .welcome-product {
    padding: 12px;
    gap: 10px;
  }

  .welcome-product-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .welcome-product-title {
    font-size: 0.84rem;
  }

  .welcome-product-desc {
    font-size: 0.72rem;
  }

  .welcome-prompt {
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .composer {
    padding-left: 16px;
  }

  .composer-input {
    font-size: 16px;
  }

  .composer-hint {
    display: none;
  }

  .chat-item-del {
    opacity: 1;
  }
}

@media (min-width: 821px) {
  #btnMenu {
    opacity: 1;
    background: var(--bg-hover);
    color: var(--text);
  }

  .app.sidebar-closed .sidebar {
    width: 0;
    min-width: 0;
    padding: 0;
    border-right: none;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
  }
}
