/**
 * Shared TuMicha Ask chat chrome — parity with Admin Ask.
 * Used by Business Ask (.business-ask) and Personal Ask (.shop-assistant).
 */

.business-ask,
.shop-assistant {
  --ask-composer-radius: 1.75rem;
  --ask-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ask-ink: #121212;
  --ask-muted: #616161;
  --ask-panel: #fff;
  --ask-canvas-a: #f7f7f8;
  --ask-canvas-b: #f3f3f4;
}

/* —— Business Ask shell —— */
.business-overview:has(> .business-ask) {
  gap: 0;
  min-height: calc(100vh - 7.5rem);
  padding: 0;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(18, 18, 18, 0.05), transparent 60%),
    linear-gradient(180deg, var(--ask-canvas-a) 0%, var(--ask-canvas-b) 42%, var(--ask-canvas-b) 100%);
}

.business-ask {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: inherit;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none !important;
  filter: none;
}

.business-ask-atmos,
.shop-assistant-atmos {
  display: none;
}

.business-ask-column,
.shop-assistant-column {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 48rem;
  width: min(100%, 48rem);
  margin: 0 auto;
  min-height: 0;
  padding: 0.75rem 1.1rem 1.1rem;
}

.business-ask-stage,
.shop-assistant-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 1rem;
}

.business-ask-head,
.shop-assistant-head {
  animation: tm-ask-head-in 520ms var(--ask-ease) both;
}

.business-ask:not(.is-chatting) .business-ask-stage,
.shop-assistant:not(.is-chatting) .shop-assistant-stage {
  justify-content: center;
}

.business-ask:not(.is-chatting) .business-ask-head,
.shop-assistant:not(.is-chatting) .shop-assistant-head {
  display: grid;
  gap: 1.35rem;
  padding: 1.5rem 0.35rem 0.5rem;
  text-align: center;
  overflow: visible;
}

.business-ask:not(.is-chatting) .business-ask-greeting,
.shop-assistant:not(.is-chatting) .shop-assistant-greeting {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  overflow: visible;
  width: 100%;
}

.business-ask.is-chatting .business-ask-stage,
.shop-assistant.is-chatting .shop-assistant-stage {
  justify-content: flex-start;
}

.business-ask.is-chatting .business-ask-head,
.shop-assistant.is-chatting .shop-assistant-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0 0.55rem;
  background: linear-gradient(180deg, var(--ask-canvas-a) 55%, transparent);
}

.business-ask.is-chatting .business-ask-greeting,
.shop-assistant.is-chatting .shop-assistant-greeting {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.business-ask.is-chatting .business-ask-kicker,
.business-ask.is-chatting .business-ask-lead,
.business-ask.is-chatting .business-ask-starters,
.shop-assistant.is-chatting .shop-assistant-kicker,
.shop-assistant.is-chatting .shop-assistant-lead,
.shop-assistant.is-chatting .shop-assistant-starters {
  display: none;
}

.business-ask.is-chatting .business-ask-spark,
.shop-assistant.is-chatting .shop-assistant-spark {
  width: 1.85rem;
  height: 1.85rem;
}

.business-ask.is-chatting .business-ask-spark svg,
.shop-assistant.is-chatting .shop-assistant-spark svg {
  width: 1rem;
  height: 1rem;
}

.business-ask.is-chatting .business-ask-brand,
.shop-assistant.is-chatting .shop-assistant-brand {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  padding: 0.04em 0.12em;
  overflow: visible;
}

@keyframes tm-ask-head-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.business-ask-spark,
.shop-assistant-spark {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 1rem;
  color: var(--ask-ink);
  background:
    linear-gradient(145deg, rgba(18, 18, 18, 0.08), rgba(18, 18, 18, 0.02)),
    var(--ask-panel);
  border: 1px solid rgba(18, 18, 18, 0.08);
  box-shadow: none;
  animation: tm-ask-spark 2.8s ease-in-out infinite;
}

@keyframes tm-ask-spark {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.business-ask-kicker,
.shop-assistant-kicker {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ask-muted);
  font-weight: 650;
}

.business-ask-brand,
.shop-assistant-brand {
  margin: 0;
  font-family: var(--font-display, var(--font-brand, inherit));
  font-size: clamp(2.1rem, 4.2vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ask-ink);
  line-height: 1.2;
  padding: 0.06em 0.18em;
  overflow: visible;
}

.business-ask-brand-em,
.shop-assistant-brand-em {
  font-style: italic;
  font-weight: 700;
  padding: 0 0.08em 0 0.02em;
  background: linear-gradient(120deg, #121212 0%, #4b5563 55%, #121212 100%);
  background-size: 180% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  animation: tm-ask-brand-shift 7s ease-in-out infinite;
}

@keyframes tm-ask-brand-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.business-ask-lead,
.shop-assistant-lead {
  margin: 0.2rem 0 0;
  color: var(--ask-muted);
  max-width: 34rem;
  line-height: 1.5;
  font-size: 0.98rem;
  animation: tm-ask-head-in 600ms 50ms var(--ask-ease) both;
}

.business-ask-starters,
.shop-assistant-starters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 auto;
  width: min(100%, 34rem);
  animation: tm-ask-head-in 640ms 90ms var(--ask-ease) both;
}

.business-ask-starters.hidden,
.shop-assistant-starters.hidden {
  display: none;
}

.business-ask-starter,
.shop-assistant-starter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  text-align: left;
  border: 1px solid rgba(18, 18, 18, 0.08);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ask-ink);
  border-radius: 1.15rem;
  padding: 0.9rem 0.95rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 550;
  line-height: 1.35;
  cursor: pointer;
  box-shadow: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms var(--ask-ease);
}

.business-ask-starter:hover,
.shop-assistant-starter:hover {
  background: #fff;
  border-color: rgba(18, 18, 18, 0.14);
  transform: translateY(-2px);
}

.business-ask-starter-label,
.shop-assistant-starter-label {
  min-width: 0;
}

.business-ask-starter-go,
.shop-assistant-starter-go {
  color: var(--ask-muted);
  font-size: 1rem;
  line-height: 1;
}

.business-ask-thread,
.shop-assistant-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-height: 0;
  overflow: auto;
  padding: 0.15rem 0.1rem 0.85rem;
  scroll-behavior: smooth;
  background: transparent;
}

.business-ask-thread:empty,
.shop-assistant-thread:empty {
  display: none;
}

.business-ask.is-chatting .business-ask-thread,
.shop-assistant.is-chatting .shop-assistant-thread {
  display: flex;
}

.business-ask-turn,
.shop-assistant-turn {
  width: 100%;
  max-width: 100%;
  animation: tm-ask-bubble-in 280ms var(--ask-ease) both;
}

.business-ask-turn-row,
.shop-assistant-turn-row {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  width: 100%;
}

.business-ask-turn--user .business-ask-turn-row,
.shop-assistant-turn--user .shop-assistant-turn-row {
  justify-content: flex-end;
}

.business-ask-turn--assistant .business-ask-turn-row,
.shop-assistant-turn--assistant .shop-assistant-turn-row {
  justify-content: flex-start;
}

.business-ask-turn-main,
.shop-assistant-turn-main {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  max-width: min(100%, 38rem);
}

.business-ask-turn--user .business-ask-turn-main,
.shop-assistant-turn--user .shop-assistant-turn-main {
  align-items: flex-end;
  max-width: min(100%, 32rem);
}

.business-ask-avatar,
.shop-assistant-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  margin-top: 0.2rem;
  border-radius: 999px;
  color: var(--ask-ink);
  background: rgba(18, 18, 18, 0.06);
  border: 1px solid rgba(18, 18, 18, 0.08);
}

@keyframes tm-ask-bubble-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.business-ask-bubble,
.shop-assistant-bubble {
  padding: 0;
  border-radius: 0;
  line-height: 1.55;
  font-size: 0.98rem;
  white-space: pre-wrap;
  box-shadow: none;
  filter: none;
}

.business-ask-bubble--assistant,
.shop-assistant-bubble--assistant {
  background: transparent;
  color: var(--ask-ink);
  border: 0;
  white-space: pre-wrap;
  padding: 0.15rem 0;
  max-width: min(100%, 38rem);
  width: 100%;
}

.business-ask-bubble--user,
.shop-assistant-bubble--user {
  background: #ececee;
  color: var(--ask-ink);
  border: 0;
  border-radius: 1.35rem 1.35rem 0.45rem 1.35rem;
  padding: 0.8rem 1rem;
  box-shadow: none;
  max-width: min(100%, 32rem);
}

.business-ask-bubble--typing,
.shop-assistant-bubble--typing {
  display: inline-flex;
  gap: 0.28rem;
  align-items: center;
  min-width: 3.2rem;
  padding: 0.55rem 0.2rem;
  width: auto;
}

.business-ask-dot,
.shop-assistant-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--ask-muted);
  animation: tm-ask-dot 1s ease-in-out infinite;
}

.business-ask-dot:nth-child(2),
.shop-assistant-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.business-ask-dot:nth-child(3),
.shop-assistant-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes tm-ask-dot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* Domain cards sit under the assistant main column */
.business-ask-turn--assistant .business-ask-apps,
.shop-assistant-turn--assistant .shop-assistant-store-list,
.shop-assistant-turn--assistant .shop-assistant-item-list {
  display: grid;
  gap: 0.45rem;
  width: min(100%, 26rem);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.business-ask-app,
.shop-assistant-store,
.shop-assistant-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background 160ms ease, border-color 160ms ease;
}

.shop-assistant-item {
  grid-template-columns: 1fr auto;
}

.business-ask-app:hover,
.business-ask-app:focus-visible,
.shop-assistant-store:hover,
.shop-assistant-store:focus-visible,
.shop-assistant-item:hover,
.shop-assistant-item:focus-within {
  background: #fff;
  border-color: rgba(18, 18, 18, 0.14);
  outline: none;
  transform: none;
}

.business-ask-app-body,
.shop-assistant-store-body {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.business-ask-app-name,
.shop-assistant-store-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ask-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.business-ask-app-meta,
.shop-assistant-store-meta {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--ask-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.business-ask-app-action,
.shop-assistant-store-go,
.shop-assistant-item-action {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ask-ink);
  white-space: nowrap;
}

.shop-assistant-item-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.shop-assistant-item-action {
  flex-shrink: 0;
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  border: 0;
  border-radius: 999px;
  background: var(--ask-ink);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow: none;
}

.shop-assistant-item-action:disabled {
  opacity: 0.65;
  cursor: wait;
}

.shop-assistant-store-thumb {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.65rem;
  background: rgba(18, 18, 18, 0.06);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ask-ink);
}

.shop-assistant-store-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.business-ask-composer,
.shop-assistant-composer {
  margin-top: auto;
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 0.65rem 0 0.15rem;
  background: transparent;
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none;
  animation: none;
}

.shop-assistant-composer {
  padding-bottom: calc(0.15rem + env(safe-area-inset-bottom, 0px));
}

.business-ask-composer-shell,
.shop-assistant-composer-shell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(18, 18, 18, 0.14);
  border-radius: var(--ask-composer-radius);
  background: #fff;
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none;
  padding: 0.45rem 0.5rem 0.45rem 1.05rem;
  transition: border-color 160ms ease;
}

.business-ask-composer-shell:focus-within,
.shop-assistant-composer-shell:focus-within {
  border-color: rgba(18, 18, 18, 0.28);
  box-shadow: none !important;
  outline: none;
}

.business-ask-composer-shell.is-multiline,
.shop-assistant-composer-shell.is-multiline {
  align-items: flex-end;
}

.business-ask-input,
.shop-assistant-input {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  resize: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  line-height: 2.55rem;
  min-height: 2.55rem;
  height: 2.55rem;
  max-height: 10rem;
  padding: 0;
  margin: 0;
  color: var(--ask-ink);
  overflow-x: hidden;
  overflow-y: hidden;
  scrollbar-width: none;
  box-shadow: none !important;
  text-shadow: none;
  field-sizing: fixed;
}

.business-ask-composer-shell.is-multiline .business-ask-input,
.shop-assistant-composer-shell.is-multiline .shop-assistant-input {
  line-height: 1.45;
  padding: 0.45rem 0;
  height: auto;
}

.business-ask-input::-webkit-scrollbar,
.shop-assistant-input::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.business-ask-input.is-scrollable,
.shop-assistant-input.is-scrollable {
  overflow-y: auto;
  scrollbar-width: thin;
}

.business-ask-input.is-scrollable::-webkit-scrollbar,
.shop-assistant-input.is-scrollable::-webkit-scrollbar {
  width: 6px;
  display: block;
}

.business-ask-input.is-scrollable::-webkit-scrollbar-thumb,
.shop-assistant-input.is-scrollable::-webkit-scrollbar-thumb {
  background: rgba(18, 18, 18, 0.2);
  border-radius: 999px;
}

.business-ask-input::placeholder,
.shop-assistant-input::placeholder {
  color: #9aa0a6;
  line-height: inherit;
}

.business-ask-input:focus,
.shop-assistant-input:focus {
  outline: none;
}

.business-ask-send,
.shop-assistant-send {
  appearance: none;
  width: 2.55rem;
  height: 2.55rem;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--ask-ink);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none;
  transition: opacity 140ms ease;
}

.business-ask-send:hover:not(:disabled),
.shop-assistant-send:hover:not(:disabled),
.business-ask-send:focus-visible:not(:disabled),
.shop-assistant-send:focus-visible:not(:disabled) {
  opacity: 0.92;
  outline: none;
  transform: none;
  background: var(--ask-ink);
}

.business-ask-send:disabled,
.shop-assistant-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.business-ask-composer-hint,
.shop-assistant-composer-hint {
  margin: 0.45rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--ask-muted);
}

.business-ask-feedback,
.shop-assistant-feedback {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.business-ask-feedback-label,
.shop-assistant-feedback-label {
  font-size: 0.78rem;
  line-height: 1.85rem;
  color: var(--ask-muted);
  white-space: nowrap;
}

.business-ask-feedback-btn,
.shop-assistant-feedback-btn {
  appearance: none;
  box-sizing: border-box;
  border: 1px solid rgba(18, 18, 18, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ask-ink);
  border-radius: 999px;
  width: auto;
  min-width: 2.4rem;
  height: 1.85rem;
  padding: 0 0.7rem;
  margin: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.business-ask-feedback-btn.is-selected,
.shop-assistant-feedback-btn.is-selected {
  background: var(--ask-ink);
  border-color: var(--ask-ink);
  color: #fff;
}

.business-ask-feedback-btn:disabled:not(.is-selected),
.shop-assistant-feedback-btn:disabled:not(.is-selected) {
  opacity: 0.45;
}

@media (max-width: 720px) {
  .business-ask-column,
  .shop-assistant-column {
    padding: 0.55rem 0.75rem 0.9rem;
  }

  .business-ask-brand,
  .shop-assistant-brand {
    font-size: clamp(1.75rem, 8vw, 2.2rem);
  }

  .business-ask-starters,
  .shop-assistant-starters {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .business-ask-composer-hint,
  .shop-assistant-composer-hint {
    display: none;
  }

  .business-overview:has(> .business-ask) {
    min-height: calc(100vh - 6.25rem);
  }
}
