:root {
  --purple-900: #190a32;
  --purple-700: #512098;
  --purple-600: #6f2dbd;
  --purple-500: #7d3bd6;
  --purple-100: #eadcff;
  --purple-50: #f7f1ff;
  --orange-600: #e95300;
  --orange-500: #ff6b12;
  --orange-100: #ffe2cd;
  --orange-50: #fff3e8;
  --ink-950: #13091f;
  --ink-800: #2d2141;
  --ink-650: #5e526f;
  --ink-500: #8d829d;
  --ink-300: #d9d2e2;
  --ink-160: #eee9f2;
  --ink-80: #f8f5f8;
  --cream: #fbf4ec;
  --surface: #fffdf9;
  --mint: #dff8ec;
  --line: rgba(45, 33, 65, .08);
  --green: #17a66a;
  --danger: #d94356;
  --shadow-soft: 0 18px 46px rgba(46, 19, 72, .13);
  --shadow-card: 0 10px 26px rgba(46, 19, 72, .08);
  --font: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html,
body,
#root {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 6%, rgba(255, 107, 18, .14), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(111, 45, 189, .14), transparent 34%),
    var(--cream);
  font-family: var(--font);
  color: var(--ink-950);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.ai-page {
  width: min(100vw, 520px);
  height: 100svh;
  min-height: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, .98), rgba(255, 248, 240, .96) 56%, rgba(248, 241, 255, .88)),
    var(--cream);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 0 0 1px rgba(45, 33, 65, .06), 0 22px 90px rgba(31, 8, 68, .08);
}

.ai-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(155deg, rgba(255, 107, 18, .12) 0%, transparent 28%),
    linear-gradient(25deg, transparent 60%, rgba(111, 45, 189, .11) 100%),
    radial-gradient(circle at 42% 35%, rgba(255, 255, 255, .55), transparent 32%);
}

.ai-header {
  position: relative;
  z-index: 20;
  flex: 0 0 74px;
  padding: 12px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 252, 248, .86);
  border-bottom: 1px solid rgba(45, 33, 65, .065);
  backdrop-filter: blur(24px) saturate(1.08);
}

.ai-header::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--orange-500), rgba(111, 45, 189, .72), transparent);
  opacity: .55;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .84);
  border: 1px solid rgba(111, 45, 189, .10);
  box-shadow: 0 12px 24px rgba(111, 45, 189, .12);
}

.brand-mark img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.brand-title {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0;
}

.brand-status {
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-500);
  font-size: 11.5px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(23, 166, 106, .12);
}

.header-action {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .76);
  color: var(--ink-650);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(46, 19, 72, .06);
}

.header-action img {
  width: 19px;
  height: 19px;
  object-fit: contain;
}

.cart-action span {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--orange-500);
  color: #fff;
  font: 900 10px Manrope, var(--font);
  box-shadow: 0 4px 10px rgba(255, 107, 18, .24);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-menu-wrap {
  position: relative;
  z-index: 92;
}

.user-chip {
  max-width: 116px;
  height: 40px;
  border: 1px solid rgba(45, 33, 65, .08);
  border-radius: 999px;
  padding: 4px 10px 4px 5px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, .76);
  color: var(--ink-800);
  box-shadow: 0 8px 18px rgba(46, 19, 72, .055);
}

.user-chip.active {
  border-color: rgba(111, 45, 189, .22);
  background: rgba(255, 255, 255, .94);
}

.user-chip span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--purple-600), var(--orange-500));
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.user-chip b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.account-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 208px;
  border: 1px solid rgba(45, 33, 65, .08);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 253, 249, .98);
  box-shadow: 0 18px 44px rgba(25, 10, 50, .18);
}

.account-summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 4px 3px 10px;
}

.account-summary > span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--purple-600), var(--orange-500));
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.account-summary b,
.account-summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-summary b {
  color: var(--ink-900);
  font-size: 13px;
}

.account-summary small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 11px;
}

.account-popover button {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: rgba(248, 245, 248, .95);
  color: var(--danger);
  font-size: 13px;
  font-weight: 900;
}

.account-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  border: 0;
  background: transparent;
}

.thread {
  flex: 1;
  min-height: 0;
  padding: 14px 14px 18px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.thread::-webkit-scrollbar {
  display: none;
}

.day-pill {
  width: fit-content;
  margin: 2px auto 14px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .76);
  color: var(--ink-500);
  font-size: 11px;
}

.message {
  display: flex;
  gap: 9px;
  margin: 10px 0;
}

.message.user {
  justify-content: flex-end;
}

.card-message {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 10px 0 12px;
}

.card-avatar {
  transform: scale(.92);
  transform-origin: top center;
}

.card-stack {
  width: min(342px, calc(100% - 42px));
  display: grid;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .76);
  border: 1px solid rgba(111, 45, 189, .09);
  box-shadow: 0 8px 18px rgba(111, 45, 189, .10);
}

.avatar img {
  width: 31px;
  height: 31px;
}

.bubble {
  max-width: min(82%, 360px);
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 9px 22px rgba(31, 8, 68, .06);
}

.message.assistant .bubble {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(45, 33, 65, .055);
  border-top-left-radius: 8px;
}

.message.user .bubble {
  background: linear-gradient(135deg, #ff8a3c, #ff6410 64%, #f05a0a);
  color: #fff;
  border-bottom-right-radius: 8px;
  box-shadow: 0 11px 24px rgba(255, 107, 18, .18);
}

.assistant-panel {
  margin: 12px 0 12px 40px;
  padding: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  padding: 0 2px;
}

.panel-head b {
  font-size: 13px;
}

.panel-head span {
  color: var(--ink-500);
  font-size: 11px;
}

.capability-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.capability-card {
  min-width: 0;
  min-height: 74px;
  border: 1px solid rgba(45, 33, 65, .075);
  border-radius: 8px;
  padding: 10px 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .74)),
    var(--surface);
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  box-shadow: 0 8px 20px rgba(46, 19, 72, .055);
}

.capability-card:active {
  transform: scale(.98);
}

.capability-card.active {
  border-color: rgba(255, 107, 18, .46);
  background:
    linear-gradient(180deg, rgba(255, 247, 241, .96), rgba(255, 255, 255, .82)),
    var(--surface);
  box-shadow: 0 12px 26px rgba(255, 107, 18, .13);
}

.capability-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-shell {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 238, 225, .92), rgba(244, 236, 255, .96));
}

.icon-shell img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.capability-card b {
  display: block;
  font-size: 13px;
}

.capability-card small {
  display: block;
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 10.5px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-strip {
  margin: 12px 0 0 40px;
  display: flex;
  gap: 7px;
  overflow: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.sample-strip::-webkit-scrollbar {
  display: none;
}

.sample-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(111, 45, 189, .15);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, .78);
  color: var(--purple-700);
  font-size: 11.5px;
}

.typing-row {
  margin-left: 40px;
  margin-top: 8px;
  color: var(--ink-500);
  font-size: 12px;
  display: flex;
  gap: 5px;
  align-items: center;
}

.typing-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--purple-500);
  animation: blink 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: .12s; }
.typing-dot:nth-child(3) { animation-delay: .24s; }

@keyframes blink {
  0%, 100% { opacity: .28; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

.order-card {
  margin: 0;
  border: 1px solid rgba(45, 33, 65, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.agent-card {
  margin: 0;
  border: 1px solid rgba(45, 33, 65, .075);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 14px 34px rgba(46, 19, 72, .105);
  overflow: hidden;
}

.card-title-row {
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(45, 33, 65, .06);
  background: linear-gradient(90deg, rgba(255, 243, 232, .82), rgba(247, 241, 255, .82));
}

.card-title-row b {
  font-size: 13px;
}

.card-title-row span {
  color: var(--ink-500);
  font-size: 11px;
}

.recommend-list,
.cart-list {
  padding: 10px;
  display: grid;
  gap: 9px;
}

.recommend-item,
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.recommend-item img,
.cart-item img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(251, 244, 236, .72);
  flex: 0 0 auto;
}

.recommend-item > div,
.cart-item-main {
  flex: 1;
  min-width: 0;
}

.recommend-item b,
.cart-item b {
  display: block;
  font-size: 13px;
}

.recommend-item small,
.cart-item small {
  display: block;
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.35;
}

.recommend-item em {
  display: block;
  margin-top: 5px;
  color: var(--orange-600);
  font: normal 800 13px Manrope, var(--font);
}

.service-card .card-title-row {
  background:
    linear-gradient(90deg, rgba(247, 241, 255, .92), rgba(223, 248, 236, .78)),
    #fff;
}

.service-item img,
.booking-card .order-item img {
  background: linear-gradient(135deg, rgba(247, 241, 255, .96), rgba(223, 248, 236, .78));
}

.service-item > button {
  background: rgba(111, 45, 189, .11);
  color: var(--purple-700);
}

.clarify-card {
  padding-bottom: 12px;
}

.clarify-card p,
.empty-copy {
  margin: 12px 14px;
  color: var(--ink-800);
  font-size: 13px;
  line-height: 1.5;
}

.option-grid {
  padding: 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-grid button,
.option-choice-row button {
  border: 1px solid rgba(111, 45, 189, .14);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, .82);
  color: var(--purple-700);
  font-size: 11.5px;
  font-weight: 700;
}

.cart-item {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(45, 33, 65, .055);
}

.cart-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.cart-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.cart-item-head span {
  color: var(--orange-600);
  font: 800 13px Manrope, var(--font);
}

.cart-item-details {
  margin-top: 8px;
  padding: 8px 9px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(248, 245, 248, .78), rgba(255, 253, 249, .86));
  display: grid;
  gap: 5px;
}

.cart-detail-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  font-size: 11.5px;
  line-height: 1.35;
}

.cart-detail-row span {
  color: var(--ink-500);
}

.cart-detail-row b {
  color: var(--ink-800);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.option-groups {
  margin-top: 10px;
  display: grid;
  gap: 9px;
}

.option-choice-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.option-choice-row > span {
  padding-top: 7px;
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 700;
}

.option-choice-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.option-choice-row button {
  padding: 6px 9px;
  font-size: 10.5px;
}

.option-choice-row button.active {
  border-color: rgba(255, 107, 18, .36);
  background: rgba(255, 107, 18, .12);
  color: var(--orange-600);
}

.quantity-control {
  align-items: center;
}

.quantity-control b {
  min-width: 22px;
  text-align: center;
  font: 900 12px Manrope, var(--font);
}

.quantity-control button {
  min-width: 28px;
}

.quantity-control button:last-child {
  color: var(--danger);
}

.cart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-top: 1px solid rgba(45, 33, 65, .06);
  background: rgba(255, 253, 249, .86);
}

.cart-footer span,
.cart-footer b {
  display: block;
}

.cart-footer span {
  color: var(--ink-500);
  font-size: 11px;
}

.cart-footer b {
  margin-top: 2px;
  color: var(--ink-950);
  font: 900 16px Manrope, var(--font);
}

.cart-footer button {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #ff8a3c, #ff5e0b);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.order-head {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(45, 33, 65, .06);
  background:
    linear-gradient(90deg, rgba(255, 243, 232, .82), rgba(247, 241, 255, .82)),
    #fff;
}

.order-head-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.order-head-title img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}

.order-head-title b {
  display: block;
  font-size: 13px;
}

.order-head-title span {
  display: block;
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 11px;
}

.state-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 107, 18, .10);
  color: var(--orange-600);
  font-size: 11px;
  font-weight: 700;
}

.order-body {
  padding: 12px;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 11px;
}

.order-item:last-child {
  margin-bottom: 0;
}

.order-item img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(251, 244, 236, .72);
}

.order-item-copy {
  flex: 1;
  min-width: 0;
}

.order-item-copy b,
.order-item-copy small {
  display: block;
}

.order-item-copy b {
  font-size: 14px;
}

.order-item-copy small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-item-specs {
  margin-top: 5px;
  display: grid;
  gap: 3px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.35;
}

.order-price {
  font: 700 14px Manrope, var(--font);
  color: var(--orange-600);
}

.order-meta {
  margin-top: 13px;
  padding: 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(248, 245, 248, .86), rgba(251, 247, 241, .88));
  display: grid;
  gap: 8px;
}

.meta-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  font-size: 11.5px;
}

.meta-row span:first-child {
  color: var(--ink-500);
}

.meta-row span:last-child {
  color: var(--ink-800);
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.confirm-note {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-650);
  font-size: 11.5px;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(223, 248, 236, .62);
}

.confirm-note img {
  width: 22px;
  height: 22px;
}

.booking-card .order-head {
  background:
    linear-gradient(90deg, rgba(247, 241, 255, .94), rgba(255, 243, 232, .68)),
    #fff;
}

.booking-card .state-pill {
  background: rgba(111, 45, 189, .10);
  color: var(--purple-700);
}

.booking-picks {
  margin-top: 13px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(248, 245, 248, .72);
  display: grid;
  gap: 8px;
}

.booking-picks span {
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 700;
}

.booking-picks div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.booking-picks button {
  border: 1px solid rgba(111, 45, 189, .14);
  border-radius: 999px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, .86);
  color: var(--purple-700);
  font-size: 11px;
  font-weight: 800;
}

.booking-footer button {
  background: linear-gradient(135deg, var(--purple-600), var(--orange-500));
}

.booking-success-card {
  border-color: rgba(111, 45, 189, .16);
}

.order-actions {
  display: grid;
  grid-template-columns: .9fr .9fr 1.35fr;
  border-top: 1px solid rgba(45, 33, 65, .06);
}

.order-actions button {
  border: 0;
  height: 46px;
  background: #fff;
  color: var(--ink-650);
  font-weight: 700;
}

.order-actions button:nth-child(2) {
  background: rgba(248, 245, 248, .92);
  color: var(--purple-700);
}

.order-actions button:last-child {
  color: #fff;
  background: linear-gradient(135deg, #ff8a3c, #ff5e0b);
}

.success-card {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(23, 166, 106, .14);
  box-shadow: var(--shadow-card);
  display: flex;
  gap: 12px;
  align-items: center;
}

.success-card img {
  width: 38px;
  height: 38px;
}

.success-card b,
.success-card small {
  display: block;
}

.success-card b {
  font-size: 14px;
}

.success-card small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 11px;
}

.history-order-list {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.history-order-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(248, 245, 248, .72), rgba(251, 247, 241, .78));
}

.history-order-item img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, .78);
}

.history-order-item b,
.history-order-item small,
.history-order-item em {
  display: block;
}

.history-order-item b {
  font-size: 13px;
}

.history-order-item small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.35;
}

.history-order-item > span {
  text-align: right;
}

.history-order-item em {
  color: var(--orange-600);
  font: normal 800 13px Manrope, var(--font);
}

.input-dock {
  position: relative;
  flex: 0 0 auto;
  z-index: 30;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(255, 253, 249, .56), rgba(251, 244, 236, .96)),
    var(--cream);
  border-top: 1px solid rgba(45, 33, 65, .06);
  backdrop-filter: blur(26px) saturate(1.08);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 3px;
  border: 1px solid rgba(45, 33, 65, .065);
  border-radius: 22px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 16px 34px rgba(46, 19, 72, .10);
}

.voice-file-input {
  display: none;
}

.composer-icon {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 16px;
  background: rgba(248, 241, 255, .92);
  display: grid;
  place-items: center;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease;
  cursor: pointer;
}

.composer-icon img {
  width: 27px;
  height: 27px;
}

.composer-icon:disabled {
  cursor: default;
  opacity: .55;
}

.composer-icon.recording {
  background: linear-gradient(135deg, #ff7a38, #ff4f5e);
  box-shadow: 0 12px 24px rgba(255, 79, 94, .25);
  animation: voicePulse 1.1s ease-in-out infinite;
}

.composer-icon.recording img {
  filter: brightness(0) invert(1);
}

.composer-icon.transcribing {
  background: rgba(255, 244, 232, .96);
}

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

.composer-input {
  flex: 1;
  min-height: 40px;
  max-height: 96px;
  resize: none;
  border: 0;
  border-radius: 16px;
  padding: 10px 5px;
  outline: none;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  line-height: 1.42;
}

.send-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff8a3c, var(--orange-500));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(255, 107, 18, .22);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 116px;
  transform: translateX(-50%);
  z-index: 50;
  width: fit-content;
  max-width: min(340px, calc(100vw - 32px));
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(25, 10, 50, .92);
  color: #fff;
  font-size: 12px;
}

.modal-layer,
.history-layer,
.cart-layer {
  position: absolute;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}

.modal-layer {
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(25, 10, 50, .28);
  pointer-events: auto;
  backdrop-filter: blur(8px);
}

.login-sheet {
  width: 100%;
  border: 1px solid rgba(45, 33, 65, .08);
  border-radius: 18px;
  padding: 20px;
  background: rgba(255, 253, 249, .98);
  box-shadow: 0 24px 64px rgba(25, 10, 50, .20);
}

.login-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(111, 45, 189, .10);
  box-shadow: 0 14px 30px rgba(111, 45, 189, .12);
}

.login-mark img {
  width: 48px;
  height: 48px;
}

.login-sheet h2 {
  margin: 14px 0 6px;
  font-size: 20px;
}

.login-sheet p {
  margin: 0 0 16px;
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.5;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(248, 245, 248, .95);
  border: 1px solid rgba(45, 33, 65, .07);
}

.auth-switch button {
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-500);
  font-weight: 900;
}

.auth-switch button.active {
  background: #fff;
  color: var(--purple-600);
  box-shadow: 0 8px 20px rgba(76, 45, 124, .10);
}

.login-sheet label {
  display: block;
  margin-top: 10px;
}

.login-sheet label span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-650);
  font-size: 12px;
  font-weight: 700;
}

.login-sheet input {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(45, 33, 65, .08);
  border-radius: 10px;
  padding: 0 12px;
  outline: none;
  background: rgba(248, 245, 248, .72);
}

.login-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.login-actions button {
  height: 44px;
  border: 0;
  border-radius: 10px;
  font-weight: 900;
}

.login-actions button:first-child {
  background: rgba(248, 245, 248, .95);
  color: var(--ink-650);
}

.login-actions button:last-child {
  background: linear-gradient(135deg, var(--orange-500), #ff8a3c);
  color: #fff;
}

.login-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.history-layer.open,
.cart-layer.open {
  pointer-events: auto;
}

.history-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(25, 10, 50, .20);
  opacity: 0;
  transition: opacity .18s ease;
}

.history-layer.open .history-scrim,
.cart-layer.open .history-scrim {
  opacity: 1;
}

.history-drawer,
.cart-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(360px, 86vw);
  height: 100%;
  padding: 18px 14px;
  background: rgba(255, 253, 249, .98);
  border-left: 1px solid rgba(45, 33, 65, .08);
  box-shadow: -18px 0 54px rgba(25, 10, 50, .16);
  transform: translateX(105%);
  transition: transform .22s ease;
  display: flex;
  flex-direction: column;
}

.history-layer.open .history-drawer,
.cart-layer.open .cart-drawer {
  transform: translateX(0);
}

.cart-drawer {
  width: min(430px, 92vw);
}

.cart-drawer-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-top: 14px;
}

.cart-drawer .cart-card {
  margin: 0;
  box-shadow: none;
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.history-head b,
.history-head span {
  display: block;
}

.history-head b {
  font-size: 18px;
}

.history-head span {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 12px;
}

.history-head button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(248, 245, 248, .94);
  color: var(--ink-650);
  font-size: 20px;
}

.new-chat-button,
.clear-history-button,
.logout-button {
  height: 42px;
  border: 0;
  border-radius: 10px;
  font-weight: 900;
}

.history-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.new-chat-button {
  background: linear-gradient(135deg, var(--purple-600), var(--orange-500));
  color: #fff;
}

.clear-history-button {
  padding: 0 13px;
  background: rgba(248, 245, 248, .95);
  color: var(--danger);
}

.clear-history-button:disabled {
  opacity: .42;
}

.history-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin-top: 12px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.history-list p {
  margin: 18px 4px;
  color: var(--ink-500);
  font-size: 13px;
}

.history-item {
  border: 1px solid rgba(45, 33, 65, .07);
  border-radius: 8px;
  padding: 0;
  background: rgba(255, 255, 255, .88);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
}

.history-item-main {
  min-width: 0;
  border: 0;
  padding: 11px;
  background: transparent;
  text-align: left;
}

.history-delete-button {
  width: 54px;
  border: 0;
  border-left: 1px solid rgba(45, 33, 65, .06);
  background: rgba(248, 245, 248, .72);
  color: var(--danger);
  font-size: 11px;
  font-weight: 900;
}

.history-item-main b,
.history-item-main small,
.history-item-main span {
  display: block;
}

.history-item-main b {
  font-size: 13px;
}

.history-item-main small {
  margin-top: 5px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.35;
}

.history-item-main span {
  margin-top: 8px;
  color: var(--purple-700);
  font-size: 10.5px;
  font-weight: 800;
}

.logout-button {
  margin-top: 10px;
  background: rgba(248, 245, 248, .95);
  color: var(--danger);
}

@media (min-width: 720px) {
  .ai-page {
    margin-top: 18px;
    margin-bottom: 18px;
    height: calc(100svh - 36px);
    border-radius: 28px;
    overflow: hidden;
  }
}
