:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
    "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei",
    "Segoe UI", Roboto, sans-serif;
  --ink: #2b2521;
  --ink-soft: #4e463f;
  --muted: #8a7f75;
  --line: #ece4dc;
  --line-soft: #f2ece5;
  --canvas: #f2eee8;
  --surface: #ffffff;
  --soft: #f8f5f1;
  --orange: #f05a28;
  --orange-dark: #d8481d;
  --orange-deep: #b73c15;
  --orange-soft: #fdf0e8;
  --orange-wash: #fef7f2;
  --orange-grad: linear-gradient(135deg, #f97a45 0%, #f05a28 55%, #e94e1b 100%);
  --espresso-grad: linear-gradient(150deg, #38312c 0%, #262120 100%);
  --green: #2f7a56;
  --green-soft: #eaf5ee;
  --red: #c04437;
  --shadow-card: 0 1px 2px rgba(87, 62, 44, 0.04), 0 12px 32px rgba(87, 62, 44, 0.08);
  --shadow-float: 0 2px 6px rgba(60, 42, 30, 0.06), 0 24px 64px rgba(60, 42, 30, 0.16);
  --ease-out: cubic-bezier(0.22, 0.9, 0.3, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

html {
  background: var(--canvas);
}

body {
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(1200px 640px at 50% -12%, #fbe3d3 0%, rgba(251, 227, 211, 0) 62%),
    linear-gradient(180deg, #f4efe9 0%, #efe9e1 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Desktop-only ambient artwork on the side gutters; fades in after the
   preloaded image is ready so first paint never flashes. */
body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("../assets/v4/design/assistant-bg@2x.png") center / cover no-repeat;
  content: "";
  opacity: 0;
  pointer-events: none;
}

@media (min-width: 880px) {
  body::before {
    animation: bg-fade-in 700ms ease-out 120ms forwards;
  }
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ai-page {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  width: min(100%, 760px);
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #faf8f5;
}

.ai-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(87, 62, 44, 0.07);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.brand-mark {
  position: relative;
  width: 40px;
  height: 40px;
  overflow: hidden;
  background: var(--orange-soft);
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #f4cdb9, 0 4px 10px rgba(240, 90, 40, 0.16);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-title {
  overflow: hidden;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #3fae74;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(63, 174, 116, 0.16);
}

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

.header-action {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 11px;
  transition: background 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.header-action:hover {
  background: rgba(87, 62, 44, 0.06);
}

.header-action:active {
  transform: scale(0.94);
}

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

/* Match the user chip: white ring chip holding a 30px orange circle.
   The cart asset is a rounded square, so crop it round via CSS. */
.cart-action {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(87, 62, 44, 0.05);
  transition: border-color 160ms, box-shadow 160ms, transform 160ms var(--ease-out);
}

.cart-action:hover {
  background: #fff;
  border-color: #f0c1a8;
  box-shadow: 0 2px 8px rgba(240, 90, 40, 0.12);
}

.cart-action img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 50%;
}

.cart-action > span {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  background: var(--orange-grad);
  border: 2px solid #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(240, 90, 40, 0.35);
}

.menu-action {
  margin-left: -6px;
}

.new-chat-action {
  display: none;
}

.account-menu-wrap {
  position: relative;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 3px 12px 3px 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(87, 62, 44, 0.05);
  transition: border-color 160ms, box-shadow 160ms, transform 160ms var(--ease-out);
}

.user-chip:hover,
.user-chip.active {
  border-color: #f0c1a8;
  box-shadow: 0 2px 8px rgba(240, 90, 40, 0.12);
}

.user-chip:active {
  transform: scale(0.96);
}

.user-chip > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: var(--orange-grad);
  border-radius: 50%;
}

.user-chip b {
  max-width: 76px;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-popover {
  position: absolute;
  top: 46px;
  right: 0;
  z-index: 45;
  width: 236px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: var(--shadow-float);
  animation: pop-in 180ms var(--ease-out) both;
}

.account-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.account-summary > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  background: var(--orange-grad);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(240, 90, 40, 0.22);
}

.account-summary div {
  display: grid;
  min-width: 0;
}

.account-summary b {
  font-size: 14px;
}

.account-summary small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
}

.account-popover > button {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
  transition: background 150ms;
}

.account-popover > button:hover {
  background: #fdf1ef;
}

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

.thread {
  position: relative;
  z-index: 1;
  min-height: 0;
  padding: 20px 22px 34px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

/* WeChat/mobile WebViews only offer long-press copy when selection is
   explicitly enabled; keep buttons unselectable so taps stay taps. */
.thread,
.thread * {
  -webkit-user-select: text;
  user-select: text;
}

.thread button,
.thread button * {
  -webkit-user-select: none;
  user-select: none;
}

.thread::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: -1;
  height: 260px;
  background: url("../assets/v4/design/assistant-bg@2x.png") top center / cover no-repeat;
  content: "";
  opacity: 0.4;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 100%);
}

.thread::-webkit-scrollbar {
  width: 6px;
}

.thread::-webkit-scrollbar-thumb {
  background: rgba(87, 62, 44, 0.16);
  border-radius: 6px;
  background-clip: padding-box;
  border: 1.5px solid transparent;
}

.thread::-webkit-scrollbar-thumb:hover {
  background: rgba(87, 62, 44, 0.28);
}

.day-pill {
  width: max-content;
  margin: 0 auto 20px;
  padding: 6px 13px;
  color: #97897d;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(218, 210, 203, 0.7);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  animation: message-in 260ms var(--ease-out) both;
}

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

.avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  overflow: hidden;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px #eddccf, 0 4px 12px rgba(87, 62, 44, 0.12);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bubble {
  max-width: min(78%, 500px);
  padding: 12px 15px;
  font-size: 14.5px;
  line-height: 1.7;
  word-break: break-word;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 4px 18px 18px 18px;
  box-shadow: 0 2px 10px rgba(87, 62, 44, 0.05);
}

.message.user .bubble {
  color: #fff;
  background: var(--orange-grad);
  border: 0;
  padding: 13px 16px;
  border-radius: 18px 4px 18px 18px;
  box-shadow: 0 6px 18px rgba(240, 90, 40, 0.28);
}

.assistant-panel {
  width: min(100% - 44px, 530px);
  margin: 10px 0 24px 44px;
  animation: message-in 320ms var(--ease-out) both;
}

.welcome-art {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  margin-bottom: 14px;
  padding: 16px 18px;
  overflow: hidden;
  background: linear-gradient(120deg, #fff 0%, #fff6ef 100%);
  border: 1px solid #f3e2d4;
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.welcome-art::after {
  position: absolute;
  top: -60px;
  right: -40px;
  width: 170px;
  height: 170px;
  background: radial-gradient(circle, rgba(240, 90, 40, 0.1) 0%, rgba(240, 90, 40, 0) 68%);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.welcome-art > img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 4px #f4cdb9, 0 6px 16px rgba(240, 90, 40, 0.18);
}

.welcome-art > div {
  min-width: 0;
}

.welcome-art b {
  display: block;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.welcome-art p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.panel-head,
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head {
  margin-bottom: 9px;
  padding-inline: 4px;
}

.panel-head b {
  font-size: 13px;
  color: var(--ink-soft);
}

.panel-head span {
  color: #b0a498;
  font-size: 11px;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.capability-card {
  min-width: 0;
  padding: 13px 12px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  box-shadow: 0 1px 3px rgba(87, 62, 44, 0.04);
  text-align: left;
  transition: border-color 180ms, box-shadow 180ms, transform 180ms var(--ease-out);
}

.capability-card:hover,
.capability-card.active {
  border-color: #f2c4ab;
  box-shadow: 0 6px 18px rgba(240, 90, 40, 0.12);
  transform: translateY(-1px);
}

.capability-card:active {
  transform: translateY(0) scale(0.98);
}

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

.icon-shell {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  background: linear-gradient(150deg, #fdf2ea, #faeadf);
  border-radius: 11px;
}

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

.capability-top div {
  min-width: 0;
}

.capability-top b,
.capability-top small {
  display: block;
}

.capability-top b {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capability-top small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  width: min(92%, 560px);
  margin: 4px 0 20px;
  animation: message-in 260ms var(--ease-out) both;
}

.card-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.agent-card,
.order-card,
.success-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.agent-card {
  padding: 16px;
}

.card-title-row {
  margin-bottom: 13px;
}

.card-title-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

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

.card-title-row small {
  color: var(--muted);
  font-size: 11px;
}

.card-title-row > span {
  flex: 0 0 auto;
  padding: 5px 10px;
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 600;
  background: var(--orange-soft);
  border-radius: 999px;
}

.recommend-list,
.cart-list,
.history-order-list {
  display: grid;
  gap: 12px;
}

.recommend-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

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

.recommend-item > img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  background: var(--soft);
  border-radius: 13px;
  box-shadow: 0 2px 8px rgba(87, 62, 44, 0.09);
}

.recommend-item > div {
  min-width: 0;
}

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

.recommend-item b {
  font-size: 13.5px;
}

.recommend-item small {
  margin: 4px 0 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
}

.recommend-item em {
  color: var(--orange-dark);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.clarify-card p,
.empty-copy {
  margin: 0 0 13px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.65;
}

.empty-copy {
  color: var(--muted);
}

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

.option-grid button,
.option-choice-row button,
.meeting-room-tile button {
  padding: 8px 13px;
  color: var(--ink-soft);
  font-size: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 150ms, background 150ms, border-color 150ms, transform 150ms var(--ease-out);
}

.option-grid button:hover,
.option-choice-row button:hover:not(:disabled) {
  color: var(--orange-dark);
  background: var(--orange-wash);
  border-color: #f0bfa4;
}

.option-grid button:active,
.option-choice-row button:active:not(:disabled) {
  transform: scale(0.96);
}

.option-choice-row button.active {
  color: var(--orange-dark);
  font-weight: 650;
  background: var(--orange-soft);
  border-color: #eda67f;
  box-shadow: inset 0 0 0 0.5px #eda67f;
}

.cart-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.cart-item > img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  background: var(--soft);
  border-radius: 13px;
  box-shadow: 0 2px 8px rgba(87, 62, 44, 0.09);
}

.cart-item-main {
  min-width: 0;
}

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

.cart-item-head span {
  color: var(--orange-dark);
  font-weight: 700;
}

.cart-item-details {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.cart-detail-row,
.meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cart-detail-row {
  color: var(--muted);
  font-size: 11px;
}

.cart-detail-row b {
  color: var(--ink-soft);
  font-weight: 600;
  text-align: right;
}

.option-groups {
  display: grid;
  gap: 8px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px dashed #e4dad0;
}

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

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

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

.option-choice-row button {
  padding: 6px 10px;
  font-size: 11px;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.quantity-control b {
  min-width: 22px;
  font-size: 12.5px;
  text-align: center;
}

.quantity-control button:last-child {
  margin-left: auto;
  color: var(--red);
  background: #fdf3f1;
  border-color: #f3d7d2;
}

.quantity-control button:last-child:hover:not(:disabled) {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.cart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 15px -16px -16px;
  padding: 13px 16px;
  background: var(--espresso-grad);
}

/* Inside .order-card the footer is a direct child (no padded wrapper),
   so the negative margins above would push it out of the card. */
.order-card > .cart-footer {
  margin: 0;
}

.cart-footer > div {
  display: grid;
  color: #fff;
}

.cart-footer span {
  color: #b9b0a9;
  font-size: 11px;
}

.cart-footer b {
  margin-top: 2px;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.cart-footer button {
  min-width: 104px;
  padding: 11px 18px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: var(--orange-grad);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(240, 90, 40, 0.4);
  transition: transform 160ms var(--ease-out), box-shadow 160ms;
}

.cart-footer button:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(240, 90, 40, 0.5);
  transform: translateY(-1px);
}

.cart-footer button:active:not(:disabled) {
  transform: scale(0.97);
}

.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--espresso-grad);
}

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

.order-head-title img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.order-head-title div {
  display: grid;
  min-width: 0;
}

.order-head-title b {
  color: #fff;
  font-size: 13.5px;
}

.order-head-title span {
  margin-top: 3px;
  overflow: hidden;
  color: #bfb5ad;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-pill {
  flex: 0 0 auto;
  padding: 5px 10px;
  color: #ffd2ba;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(240, 90, 40, 0.22);
  border: 1px solid rgba(255, 185, 149, 0.36);
  border-radius: 999px;
}

.order-body {
  padding: 15px 16px;
}

.order-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.order-item > img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(87, 62, 44, 0.09);
}

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

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

.order-item-specs {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.order-price {
  color: var(--orange-dark);
  font-size: 13px;
  font-weight: 700;
}

.order-meta {
  display: grid;
  gap: 9px;
  padding-top: 13px;
}

.meta-row {
  color: var(--muted);
  font-size: 11.5px;
}

.meta-row span:last-child {
  max-width: 66%;
  color: var(--ink-soft);
  font-weight: 600;
  text-align: right;
}

.confirm-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 13px;
  padding: 10px 12px;
  color: #8a5a41;
  font-size: 11px;
  line-height: 1.55;
  background: var(--orange-wash);
  border: 1px solid #f7dcc9;
  border-radius: 12px;
}

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

.order-actions {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr 1.4fr;
  gap: 9px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line-soft);
}

.order-actions button {
  min-height: 44px;
  padding: 9px;
  font-size: 13px;
  font-weight: 600;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 150ms, border-color 150ms, transform 150ms var(--ease-out), box-shadow 150ms;
}

.order-actions button:hover:not(:disabled) {
  background: #f2ede7;
}

.order-actions button:active:not(:disabled) {
  transform: scale(0.97);
}

.order-actions button:last-child {
  color: #fff;
  font-weight: 700;
  background: var(--orange-grad);
  border: 0;
  box-shadow: 0 4px 14px rgba(240, 90, 40, 0.35);
}

.order-actions button:last-child:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(240, 90, 40, 0.45);
}

.success-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  background: linear-gradient(120deg, #fff 30%, #f0f9f3 100%);
  border-color: #d9ecdf;
}

.success-card > img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(47, 122, 86, 0.2));
}

.success-card > div {
  display: grid;
  min-width: 0;
}

.success-card b {
  color: var(--green);
  font-size: 14px;
}

.success-card small,
.success-card span {
  margin-top: 4px;
  color: #6d8577;
  font-size: 11.5px;
  line-height: 1.5;
}

.meeting-room-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.meeting-room-tile {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  transition: border-color 180ms, box-shadow 180ms, transform 180ms var(--ease-out);
}

.meeting-room-tile:not(.unavailable):hover {
  border-color: #cfdcd4;
  box-shadow: 0 6px 18px rgba(63, 88, 80, 0.12);
  transform: translateY(-1px);
}

.meeting-room-tile.unavailable {
  background: var(--soft);
  filter: grayscale(0.55);
  opacity: 0.6;
}

.meeting-room-photo {
  display: grid;
  place-content: center;
  width: 50px;
  height: 50px;
  color: #fff;
  text-align: center;
  background: linear-gradient(150deg, #587569 0%, #3f584e 100%);
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(63, 88, 78, 0.24);
}

.meeting-room-photo span {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.meeting-room-photo small {
  margin-top: 1px;
  color: #cfe0d7;
  font-size: 10px;
}

.meeting-room-copy {
  min-width: 0;
}

.meeting-room-copy b,
.meeting-room-copy small,
.meeting-room-copy p {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-room-copy b {
  font-size: 12.5px;
}

.meeting-room-copy small,
.meeting-room-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

.meeting-room-tile > button {
  grid-column: 1 / -1;
  width: 100%;
  padding-block: 9px;
  color: #fff;
  font-weight: 650;
  background: linear-gradient(150deg, #3d8a63, #2f7a56);
  border: 0;
  box-shadow: 0 3px 10px rgba(47, 122, 86, 0.26);
}

.meeting-room-tile > button:hover:not(:disabled) {
  color: #fff;
  background: linear-gradient(150deg, #45996f, #35875f);
  border: 0;
}

.meeting-room-tile.unavailable > button {
  background: #b9c4be;
  box-shadow: none;
}

.meeting-confirm-room {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.meeting-confirm-room .meeting-room-photo {
  width: 60px;
  height: 60px;
  border-radius: 14px;
}

.meeting-confirm-room > div:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.meeting-confirm-room b {
  font-size: 13.5px;
}

.meeting-confirm-room small,
.meeting-confirm-room p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.meeting-room-empty,
.booking-missing,
.booking-warning {
  margin: 0;
  padding: 11px 13px;
  font-size: 11.5px;
  line-height: 1.55;
  background: var(--soft);
  border-radius: 12px;
}

.booking-missing {
  margin-top: 11px;
  color: #8a5a41;
  background: var(--orange-wash);
  border: 1px solid #f7dcc9;
}

.booking-warning {
  margin-top: 11px;
  color: var(--red);
  background: #fdf1ef;
  border: 1px solid #f5d5d0;
}

.history-order-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

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

.history-order-item > img {
  width: 38px;
  height: 38px;
  padding: 6px;
  object-fit: contain;
  background: var(--soft);
  border-radius: 11px;
}

.history-order-item > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.history-order-item b {
  overflow: hidden;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-order-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-order-item > span {
  display: grid;
  gap: 2px;
  text-align: right;
}

.history-order-item em {
  color: var(--orange-dark);
  font-size: 12.5px;
  font-style: normal;
  font-weight: 700;
}

.history-order-item > span small {
  color: #a99d91;
}

.typing-row {
  display: flex;
  align-items: center;
  width: max-content;
  margin: 0 0 18px 44px;
  padding: 9px 13px;
  color: var(--muted);
  font-size: 11.5px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 2px 10px rgba(87, 62, 44, 0.05);
  animation: message-in 220ms var(--ease-out) both;
}

.typing-dot {
  width: 5px;
  height: 5px;
  margin-left: 4px;
  background: var(--orange);
  border-radius: 50%;
  animation: typing 900ms infinite ease-in-out;
}

.typing-dot:nth-child(3) {
  animation-delay: 120ms;
}

.typing-dot:nth-child(4) {
  animation-delay: 240ms;
}

.input-dock {
  position: relative;
  z-index: 18;
  padding: 10px 16px max(14px, env(safe-area-inset-bottom));
  background: rgba(250, 248, 245, 0.88);
  border-top: 1px solid rgba(87, 62, 44, 0.06);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

.composer {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: end;
  gap: 7px;
  padding: 6px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 2px 6px rgba(87, 62, 44, 0.05), 0 10px 28px rgba(87, 62, 44, 0.07);
  transition: border-color 180ms, box-shadow 180ms;
}

.composer:focus-within {
  border-color: #f0ab84;
  box-shadow: 0 2px 6px rgba(87, 62, 44, 0.05), 0 0 0 3.5px rgba(240, 90, 40, 0.1);
}

.composer-icon,
.send-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
}

.composer-icon {
  overflow: hidden;
  background: transparent;
  transition: transform 160ms var(--ease-out), background 160ms;
}

.composer-icon:hover:not(:disabled) {
  background: var(--soft);
}

.composer-icon:active:not(:disabled) {
  transform: scale(0.92);
}

.composer-icon img {
  width: 38px;
  height: 38px;
  object-fit: cover;
}

.composer-icon.recording {
  outline: 2.5px solid #e75b4f;
  outline-offset: 1.5px;
  animation: voice-pulse 1s infinite;
}

.composer-icon.transcribing {
  animation: voice-pulse 1.4s infinite;
}

.composer-input {
  width: 100%;
  max-height: 104px;
  min-height: 38px;
  padding: 8px 6px;
  resize: none;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
  background: transparent;
  border: 0;
  outline: 0;
}

.composer-input::placeholder {
  color: #b3a89c;
}

.send-button {
  color: #fff;
  font-size: 19px;
  background: var(--orange-grad);
  box-shadow: 0 3px 10px rgba(240, 90, 40, 0.32);
  transition: transform 160ms var(--ease-out), box-shadow 160ms, opacity 160ms;
}

.send-button:hover:not(:disabled) {
  box-shadow: 0 5px 16px rgba(240, 90, 40, 0.42);
  transform: translateY(-1px);
}

.send-button:active:not(:disabled) {
  transform: scale(0.92);
}

.send-button:disabled {
  background: #e5ddd4;
  box-shadow: none;
  opacity: 1;
}

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

.toast {
  position: fixed;
  bottom: 92px;
  left: 50%;
  z-index: 80;
  max-width: calc(100% - 40px);
  padding: 10px 16px;
  color: #fff;
  font-size: 12.5px;
  background: rgba(38, 33, 30, 0.92);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(38, 33, 30, 0.3);
  backdrop-filter: blur(8px);
  transform: translateX(-50%);
  animation: toast-in 200ms var(--ease-out) both;
}

.history-layer,
.cart-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  visibility: hidden;
  pointer-events: none;
}

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

.history-scrim {
  position: absolute;
  inset: 0;
  background: rgba(30, 25, 21, 0.4);
  border: 0;
  opacity: 0;
  backdrop-filter: blur(2.5px);
  transition: opacity 240ms ease;
}

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

.history-drawer,
.cart-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(88vw, 370px);
  overflow: hidden;
  background: #fbfaf8;
  box-shadow: var(--shadow-float);
  transition: transform 300ms var(--ease-drawer);
}

.history-drawer {
  left: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border-radius: 0 22px 22px 0;
  transform: translateX(-102%);
}

.cart-drawer {
  right: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 22px 0 0 22px;
  transform: translateX(102%);
}

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

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.history-head > div {
  display: grid;
  gap: 3px;
}

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

.history-head span {
  color: var(--muted);
  font-size: 11.5px;
}

.history-head > button {
  width: 32px;
  height: 32px;
  font-size: 19px;
  line-height: 1;
  color: var(--muted);
  background: var(--soft);
  border: 0;
  border-radius: 50%;
  transition: background 150ms, color 150ms, transform 150ms var(--ease-out);
}

.history-head > button:hover {
  color: var(--ink);
  background: #efe9e2;
}

.history-head > button:active {
  transform: scale(0.92);
}

.history-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  padding: 14px 20px;
}

.history-actions button {
  padding: 10px 13px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: transform 150ms var(--ease-out), box-shadow 150ms;
}

.history-actions button:active:not(:disabled) {
  transform: scale(0.97);
}

.new-chat-button {
  color: #fff;
  background: var(--orange-grad) !important;
  border: 0 !important;
  box-shadow: 0 4px 12px rgba(240, 90, 40, 0.3);
}

.clear-history-button {
  color: var(--red);
}

.history-list,
.cart-drawer-body {
  min-height: 0;
  padding: 0 20px 20px;
  overflow-y: auto;
}

.history-list > p {
  color: var(--muted);
  font-size: 12.5px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

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

.history-item-main b,
.history-item-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.history-item-main small,
.history-item-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.history-delete-button {
  padding: 8px;
  color: #c9a99b;
  font-size: 11px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  transition: color 150ms, background 150ms;
}

.history-delete-button:hover {
  color: var(--red);
  background: #fdf1ef;
}

.logout-button {
  margin: 12px 20px 20px;
  padding: 11px;
  color: var(--red);
  font-weight: 600;
  background: #fdf4f2;
  border: 1px solid #f4dbd5;
  border-radius: 999px;
  transition: background 150ms, transform 150ms var(--ease-out);
}

.logout-button:hover {
  background: #fceeea;
}

.logout-button:active {
  transform: scale(0.98);
}

.cart-drawer-body {
  padding-top: 16px;
}

.cart-drawer-body .agent-card {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* The drawer header already shows the cart title and total. */
.cart-drawer-body .agent-card > .card-title-row {
  display: none;
}

.cart-drawer-body .cart-footer {
  margin: 15px 0 0;
  border-radius: 16px;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(32, 26, 22, 0.44);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.login-sheet {
  width: min(100%, 384px);
  padding: 28px 26px 26px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(30, 22, 16, 0.3);
  animation: modal-in 240ms var(--ease-out) both;
}

.login-mark {
  width: 62px;
  height: 62px;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 4px #f4cdb9, 0 8px 20px rgba(240, 90, 40, 0.2);
}

.login-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-sheet h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.01em;
}

.login-sheet > p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--soft);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

.auth-switch button {
  padding: 9px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-radius: 999px;
  transition: color 180ms, background 180ms, box-shadow 180ms;
}

.auth-switch button.active {
  color: #fff;
  background: var(--orange-grad);
  box-shadow: 0 3px 10px rgba(240, 90, 40, 0.3);
}

.login-sheet label {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}

.login-sheet label span {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.login-sheet input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  color: var(--ink);
  font-size: 14px;
  background: var(--soft);
  border: 1.5px solid var(--line);
  border-radius: 13px;
  outline: none;
  transition: border-color 180ms, background 180ms, box-shadow 180ms;
}

.login-sheet input:focus {
  background: #fff;
  border-color: #f0ab84;
  box-shadow: 0 0 0 3.5px rgba(240, 90, 40, 0.1);
}

.login-actions {
  margin-top: 20px;
}

.login-actions button {
  width: 100%;
  padding: 13px;
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  background: var(--orange-grad);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(240, 90, 40, 0.32);
  transition: transform 160ms var(--ease-out), box-shadow 160ms;
}

.login-actions button:hover:not(:disabled) {
  box-shadow: 0 8px 24px rgba(240, 90, 40, 0.42);
  transform: translateY(-1px);
}

.login-actions button:active:not(:disabled) {
  transform: scale(0.98);
}

@keyframes bg-fade-in {
  to {
    opacity: 0.5;
  }
}

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

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes typing {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2.5px);
  }
}

@keyframes voice-pulse {
  50% {
    transform: scale(0.92);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 620px) {
  .ai-page {
    width: 100%;
    border: 0;
  }

  .ai-header {
    padding-inline: 12px;
  }

  .user-chip b {
    display: none;
  }

  .user-chip {
    justify-content: center;
    width: 38px;
    padding: 0;
  }

  .new-chat-action {
    display: none;
  }

  .thread {
    padding: 16px 14px 28px;
  }

  .assistant-panel {
    width: calc(100% - 42px);
    margin-left: 42px;
  }

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

  .meeting-room-grid {
    grid-template-columns: 1fr;
  }

  .card-message {
    width: 100%;
  }

  .bubble {
    max-width: 84%;
  }

  .input-dock {
    padding-inline: 10px;
  }

  /* 16px prevents iOS Safari from auto-zooming the page when the
     composer or login inputs gain focus. */
  .composer-input,
  .login-sheet input {
    font-size: 16px;
  }
}

@media (min-width: 880px) {
  .ai-page {
    height: calc(100dvh - 40px);
    margin-top: 20px;
    border: 1px solid rgba(87, 62, 44, 0.1);
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(60, 42, 30, 0.08), 0 32px 80px rgba(60, 42, 30, 0.14);
  }
}

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

  body::before {
    opacity: 0.5;
  }
}
