/* Чуденка AI - hero search + chat */
.chai {
  --chai-yellow: #eeaf2d;
  --chai-yellow-deep: #d99a17;
  --chai-ink: #161412;
  --chai-ink-soft: #3d3830;
  --chai-muted: #7a7266;
  --chai-paper: #fffdf8;
  --chai-line: #efe7d6;
  --chai-cream: #fff6e2;
  --chai-radius: 22px;
  position: relative;
  isolation: isolate;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  color: var(--chai-ink);
  text-align: left;
}
.chai *, .chai *::before, .chai *::after { box-sizing: border-box; }
.chai { font-size: 16px; line-height: 1.5; }
.chai button { text-transform: none; letter-spacing: normal; font-style: normal; line-height: 1.2; min-height: 0; height: auto; box-shadow: none; margin: 0; }
.chai .chai-form textarea { font-size: 17px !important; line-height: 1.45 !important; }
.chai textarea, .chai input { text-transform: none; letter-spacing: normal; min-height: 0; box-shadow: none; border-radius: 0; }
.chai p { letter-spacing: normal; }

.chai--hero {
  background: var(--chai-yellow);
  padding: clamp(56px, 9vw, 120px) 16px clamp(48px, 7vw, 96px);
  overflow: hidden;
}
.chai .chai-doodles { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.chai .chai-dd { position: absolute; display: block; height: auto; max-width: none; opacity: .95; margin: 0; border: 0; box-shadow: none; }
/* desktop: the same places as the original background picture */
.chai .chai-dd--question { left: calc(50% - 441px); top: 113px; width: 87px; }
.chai .chai-dd--bubble   { left: calc(50% + 443px); top: 119px; width: 81px; }
.chai .chai-dd--bulb     { left: calc(50% - 569px); top: 383px; width: 114px; }
.chai .chai-dd--paper    { left: calc(50% + 499px); top: 388px; width: 101px; }
.chai .chai-dd--lines    { left: calc(50% - 49px);  top: 554px; width: 97px; }
.chai.is-chatting .chai-dd--lines { display: none; }
/* tablets: pull them in a little */
@media (max-width: 1100px) {
  .chai .chai-dd--question { left: 3%; top: 60px; width: 70px; }
  .chai .chai-dd--bubble   { left: auto; right: 3%; top: 66px; width: 66px; }
  .chai .chai-dd--bulb     { left: 1%; top: 330px; width: 84px; }
  .chai .chai-dd--paper    { left: auto; right: 1%; top: 336px; width: 76px; }
}
/* phones: small, in the corners, around the title and below the chips */
@media (max-width: 600px) {
  .chai .chai-dd { opacity: .9; }
  .chai .chai-dd--question { left: 10px; top: 10px; width: 38px; }
  .chai .chai-dd--bubble   { left: auto; right: 12px; top: 14px; width: 40px; }
  .chai--hero:not(.is-chatting) { padding-bottom: 92px; }
  .chai .chai-dd--bulb     { left: 14px; top: auto; bottom: 14px; width: 46px; }
  .chai .chai-dd--paper    { left: auto; right: 16px; top: auto; bottom: 16px; width: 42px; }
  .chai .chai-dd--lines    { left: calc(50% - 32px); top: auto; bottom: 22px; width: 64px; }
  .chai.is-chatting .chai-dd--bulb, .chai.is-chatting .chai-dd--paper { display: none; }
}
.chai .chai-inner { max-width: 760px; margin: 0 auto; }

.chai .chai-title {
  font-family: 'Manrope', sans-serif; font-weight: 800;
  font-size: clamp(33.6px, 5.4vw, 57.6px); line-height: 1.05; letter-spacing: -0.03em;
  text-align: center; margin: 0 0 .35em; color: var(--chai-ink);
}
.chai .chai-sub {
  text-align: center; font-size: clamp(16.3px, 1.8vw, 20px); color: var(--chai-ink-soft);
  margin: 0 auto 1.8em; max-width: 34em;
}

/* search */
.chai .chai-form {
  position: relative; display: flex; align-items: flex-end; gap: 10px;
  background: #fff; border-radius: 999px; padding: 9px 9px 9px 20px;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 18px 40px -18px rgba(90,55,0,.45);
  border: 2px solid transparent;
  transition: border-color .2s, box-shadow .2s, border-radius .2s;
}
.chai .chai-form:focus-within { border-color: var(--chai-ink); }
.chai .chai-form.is-multiline { border-radius: 26px; }
.chai .chai-spark { color: var(--chai-yellow-deep); display: flex; align-self: center; flex: none; }
.chai .chai-form textarea {
  flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent;
  font: 600 17px/1.45 'Nunito Sans', system-ui, sans-serif; color: var(--chai-ink);
  padding: 10px 0; max-height: 160px; margin: 0; box-shadow: none;
}
.chai .chai-form textarea::placeholder { color: #9b9286; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chai .chai-send {
  flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--chai-ink); color: #fff; display: grid; place-items: center; padding: 0;
  transition: transform .15s, background .15s, opacity .15s;
}
.chai .chai-send:hover { transform: translateX(2px); background: #000; }
.chai .chai-send:disabled { opacity: .35; cursor: default; transform: none; }

.chai .chai-ts:empty { display: none; }
.chai .chai-ts { display: flex; justify-content: center; margin-top: 12px; }
.chai.is-verifying .chai-ts { padding: 6px; border-radius: 12px; background: rgba(255,255,255,.35); }

/* suggestion chips */
.chai .chai-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 0; }
.chai .chai-chip {
  font: 600 14.7px/1.2 'Nunito Sans', system-ui, sans-serif; color: var(--chai-ink);
  background: rgba(255,255,255,.55); border: 1px solid rgba(22,20,18,.12);
  border-radius: 999px; padding: 9px 15px; cursor: pointer;
  transition: background .15s, transform .15s;
}
.chai .chai-chip:hover { background: #fff; transform: translateY(-1px); }

.chai .chai-note { text-align: center; font-size: 12.5px; color: rgba(22,20,18,.62); margin: 18px auto 0; max-width: 40em; line-height: 1.45; }

/* conversation */
.chai.is-chatting .chai-chips { display: none; }
.chai.is-chatting .chai-sub { display: none; }
.chai.is-chatting .chai-title { font-size: clamp(25.6px, 3.6vw, 36.8px); }
.chai .chai-thread {
  background: var(--chai-paper); border-radius: var(--chai-radius);
  padding: clamp(16px, 3vw, 28px); margin: 0 0 14px;
  box-shadow: 0 24px 60px -30px rgba(90,55,0,.55);
  animation: chai-in .35s ease;
}
.chai .chai-thread[hidden] { display: none; }
.chai .chai-thread-head { display: flex; justify-content: flex-end; margin: -6px -6px 6px 0; }
.chai .chai-reset {
  font: 700 12.8px 'Nunito Sans', sans-serif; color: var(--chai-muted); background: none; border: 0;
  cursor: pointer; padding: 6px 8px; border-radius: 8px;
}
.chai .chai-reset:hover { color: var(--chai-ink); background: var(--chai-cream); }

.chai .chai-msg { margin: 0 0 22px; animation: chai-in .3s ease; }
.chai .chai-msg:last-child { margin-bottom: 0; }
.chai .chai-msg--user { display: flex; justify-content: flex-end; }
.chai .chai-msg--user .chai-bubble {
  background: var(--chai-ink); color: #fff; border-radius: 18px 18px 4px 18px;
  padding: 10px 16px; max-width: 85%; font-weight: 600; line-height: 1.45; white-space: pre-wrap;
}
.chai .chai-msg--ai { display: grid; grid-template-columns: 38px 1fr; gap: 12px; }
.chai .chai-avatar {
  width: 38px; height: 38px; border-radius: 50%; overflow: hidden;
  background: var(--chai-yellow) url('logo-chat.png') no-repeat 0 4px / 112% auto;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.chai .chai-body { min-width: 0; font-size: 16.3px; line-height: 1.62; color: #2a2620; }
.chai .chai-body > :first-child { margin-top: 4px; }
.chai .chai-body p { margin: 0 0 .8em; }
.chai .chai-body h3, .chai .chai-body h4 { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 17.3px; margin: 1.1em 0 .4em; color: var(--chai-ink); }
.chai .chai-body ul, .chai .chai-body ol { margin: 0 0 .9em; padding-left: 1.25em; }
.chai .chai-body li { margin: .25em 0; }
.chai .chai-body strong { color: var(--chai-ink); }
.chai .chai-body a { color: var(--chai-ink); text-decoration: underline; text-decoration-color: var(--chai-yellow); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 700; }
.chai .chai-body a:hover { text-decoration-color: var(--chai-ink); }
.chai .chai-body a.is-article { text-decoration-color: var(--chai-ink); }
.chai .chai-table-wrap { overflow-x: auto; margin: .4em 0 1em; border: 1px solid var(--chai-line); border-radius: 14px; background: #fff; }
.chai .chai-body table { border-collapse: collapse; width: 100%; font-size: 14.7px; min-width: 420px; }
.chai .chai-body th, .chai .chai-body td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--chai-line); vertical-align: top; }
.chai .chai-body th { background: var(--chai-cream); font-weight: 800; font-family: 'Manrope', sans-serif; font-size: 13.1px; text-transform: uppercase; letter-spacing: .03em; }
.chai .chai-body tr:last-child td { border-bottom: 0; }
/* the theme colours table headers and stripes rows */
.chai .chai-body table, .chai .chai-body tr, .chai .chai-body td { background: #fff; color: #2a2620; }
.chai .chai-body th { color: var(--chai-ink); border-top: 0; border-left: 0; border-right: 0; }
.chai .chai-body td { border-left: 0; border-right: 0; border-top: 0; }

/* product cards + deals */
.chai .chai-card-wrap { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--chai-line); border-radius: 16px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.chai .chai-card-wrap:hover { border-color: var(--chai-yellow); box-shadow: 0 12px 24px -16px rgba(90,55,0,.5); }
.chai .chai-card-wrap .chai-card { border: 0; border-radius: 0; }
.chai .chai-card-wrap .chai-card:hover { transform: none; box-shadow: none; }
.chai .chai-card-img { position: relative; display: block; }
.chai .chai-badge { position: absolute; top: -4px; left: -4px; background: #d6342a; color: #fff; font: 800 11.5px 'Manrope', sans-serif; padding: 3px 7px; border-radius: 999px; }
.chai .chai-save { font-size: 12.5px; font-weight: 700; color: #1f7a3d; }
.chai .chai-card-deal { border-top: 1px dashed #e8d6a8; background: var(--chai-cream); padding: 9px 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
.chai .chai-card-deal .chai-deal-title { grid-column: 1 / -1; font-size: 12.5px; color: var(--chai-ink-soft); line-height: 1.3; }
.chai .chai-card-deal.is-sale { grid-template-columns: 1fr; }
.chai .chai-deal-label { font: 800 11.2px 'Manrope', sans-serif; text-transform: uppercase; letter-spacing: .05em; color: #a26d00; }
.chai .chai-code { display: inline-flex; align-items: stretch; border: 1.5px dashed #c89418; border-radius: 9px; overflow: hidden; background: #fff; }
.chai .chai-code code { font: 800 13.6px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 5px 9px; color: var(--chai-ink); background: none; letter-spacing: .03em; }
.chai .chai-copy { border: 0; background: var(--chai-ink); color: #fff; font: 700 12.2px 'Nunito Sans', sans-serif; padding: 0 11px; cursor: pointer; }
.chai .chai-copy:hover { background: #000; }
.chai .chai-copy.is-done { background: #1f7a3d; }
.chai .chai-coupon { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--chai-cream); border: 1.5px dashed #e3c477; border-radius: 16px; padding: 12px 14px; margin: .4em 0 .8em; }
.chai .chai-coupon-main { flex: 1 1 200px; display: grid; gap: 2px; }
.chai .chai-coupon-title { font-weight: 700; font-size: 14.7px; color: var(--chai-ink); line-height: 1.35; }
.chai .chai-coupon-go { font: 800 12.8px 'Manrope', sans-serif; color: var(--chai-ink) !important; text-decoration: none !important; white-space: nowrap; }

/* product cards */
.chai .chai-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 12px; margin: .4em 0 1em; }
.chai .chai-card {
  display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center;
  background: #fff; border: 1px solid var(--chai-line); border-radius: 16px; padding: 10px 12px 10px 10px;
  text-decoration: none !important; color: inherit; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.chai .chai-card:hover { border-color: var(--chai-yellow); transform: translateY(-2px); box-shadow: 0 12px 24px -16px rgba(90,55,0,.5); }
.chai .chai-card img { width: 76px; height: 76px; object-fit: contain; border-radius: 10px; background: #fff; }
.chai .chai-card-name { font-weight: 700; text-transform: none; font-size: 14.1px; line-height: 1.3; color: var(--chai-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chai .chai-card-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.chai .chai-price { font: 800 16.3px 'Manrope', sans-serif; color: var(--chai-ink); }
.chai .chai-old { font-size: 12.8px; color: var(--chai-muted); text-decoration: line-through; }
.chai .chai-store { font-size: 12.5px; color: var(--chai-muted); width: 100%; }
.chai .chai-store b { color: #b97c00; }
.chai .chai-card-cta { font: 800 12.2px 'Manrope', sans-serif; text-transform: uppercase; letter-spacing: .04em; color: var(--chai-ink); margin-top: 4px; }

.chai .chai-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: .8em 0 0; font-size: 12px; color: var(--chai-muted); }
.chai .chai-sources-label { font-weight: 700; margin-right: 2px; }
.chai .chai-sources a, .chai .chai-sources > span:not(.chai-sources-label) { color: var(--chai-muted) !important; font-weight: 600; text-decoration: none !important; background: #f5efe2; border-radius: 999px; padding: 2px 9px; }
.chai .chai-sources a:hover { color: var(--chai-ink) !important; background: #efe4c9; }

.chai .chai-price-note { font-size: 11.8px; color: var(--chai-muted); margin: -.4em 0 .8em !important; }

/* instant results strip */
.chai .chai-quick { margin: 2px 0 14px; animation: chai-in .3s ease; }
.chai .chai-quick.is-more { margin: 4px 0 6px; }
.chai .chai-quick-label { font: 800 11.5px 'Manrope', sans-serif !important; text-transform: uppercase; letter-spacing: .06em; color: #a26d00; margin: 0 0 8px !important; }
.chai .chai-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.chai .chai-mini {
  flex: 0 0 148px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 3px;
  background: #fff; border: 1px solid var(--chai-line); border-radius: 14px; padding: 8px;
  text-decoration: none !important; color: inherit !important; font-weight: 400 !important;
  transition: border-color .15s, transform .15s;
}
.chai .chai-mini:hover { border-color: var(--chai-yellow); transform: translateY(-2px); }
.chai .chai-mini-img { position: relative; display: block; height: 96px; margin-bottom: 4px; }
.chai .chai-mini-img img { width: 100%; height: 100%; object-fit: contain; }
.chai .chai-mini-name { font-size: 12.5px; font-weight: 700; line-height: 1.25; color: var(--chai-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.chai .chai-mini-price { font: 800 14.4px 'Manrope', sans-serif; color: var(--chai-ink); }
.chai .chai-mini-price s { font: 600 11.5px 'Nunito Sans', sans-serif; color: var(--chai-muted); }
.chai .chai-mini-store { font-size: 11.2px; color: var(--chai-muted); }
.chai .chai-mini-store b { color: #1f7a3d; }

/* clarifying choices */
.chai .chai-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.chai .chai-choice {
  font: 700 14.4px 'Nunito Sans', sans-serif; color: var(--chai-ink); background: #fff;
  border: 1.5px solid var(--chai-ink); border-radius: 999px; padding: 8px 16px; cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
.chai .chai-choice:hover { background: var(--chai-ink); color: #fff; transform: translateY(-1px); }
.chai .chai-choices.is-used .chai-choice { opacity: .4; cursor: default; pointer-events: none; border-color: var(--chai-line); }
.chai .chai-choices.is-used .chai-choice.is-picked { opacity: 1; background: var(--chai-cream); border-color: var(--chai-yellow); }

/* thinking */
.chai .chai-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 7px; }
.chai .chai-steps li { margin: 0; }
.chai .chai-steps .is-done { display: flex; align-items: baseline; gap: 9px; color: #a0978a; font-size: 14.4px; font-weight: 600; animation: chai-in .25s ease; }
.chai .chai-check { flex: none; width: 17px; height: 17px; border-radius: 50%; background: #f3e6c4; color: #a26d00; font-size: 10.9px; font-weight: 800; display: inline-grid; place-items: center; transform: translateY(2px); }
.chai .chai-thinking { display: flex; align-items: center; gap: 10px; color: var(--chai-ink-soft); font-weight: 700; font-size: 15.2px; animation: chai-in .25s ease; }
.chai .chai-dots { display: inline-flex; gap: 4px; }
.chai .chai-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--chai-yellow-deep); animation: chai-bounce 1s infinite ease-in-out; }
.chai .chai-dots i:nth-child(2) { animation-delay: .15s; }
.chai .chai-dots i:nth-child(3) { animation-delay: .3s; }
.chai .chai-error { color: #a23a12; font-weight: 600; }

@keyframes chai-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-5px); opacity: 1; } }
@keyframes chai-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 600px) {
  .chai .chai-form textarea { font-size: 16px !important; }
  .chai .chai-form { padding: 6px 6px 6px 14px; }
  .chai .chai-form textarea { font-size: 16px; }
  .chai .chai-send { width: 44px; height: 44px; }
  .chai .chai-chip { font-size: 13.6px; padding: 8px 12px; }
  .chai .chai-chips .chai-chip:nth-child(n+4) { display: none; }
  .chai .chai-msg--ai { grid-template-columns: 1fr; gap: 6px; }
  .chai .chai-avatar { width: 32px; height: 32px; }
  .chai .chai-cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .chai *, .chai { animation: none !important; transition: none !important; }
}
