:root {
  --ink: #21123d;
  --ink-soft: #756c82;
  --cream: #fff8ef;
  --paper: #fffdf9;
  --line: rgba(64, 34, 94, 0.12);
  --line-strong: rgba(64, 34, 94, 0.19);
  --orange: #ff682f;
  --pink: #f52f72;
  --purple: #6f2bd0;
  --success: #27a96b;
  --danger: #c53658;
  --shadow: 0 22px 60px rgba(64, 26, 80, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--cream);
}

body {
  min-height: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(111, 43, 208, 0.24);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.web-chat-page {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 122, 55, 0.17), transparent 29rem),
    radial-gradient(circle at 94% 88%, rgba(191, 48, 195, 0.13), transparent 31rem),
    var(--cream);
}

.chat-app {
  position: relative;
  display: grid;
  width: min(1420px, calc(100% - 28px));
  height: calc(100vh - 28px);
  height: calc(100dvh - 28px);
  min-width: 0;
  margin: 14px auto;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) 390px;
  background: rgba(255, 253, 249, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.chat-main {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background:
    linear-gradient(rgba(255, 253, 249, 0.87), rgba(255, 253, 249, 0.87)),
    radial-gradient(circle at 50% 15%, rgba(255, 104, 47, 0.07), transparent 25rem);
}

.chat-header {
  position: relative;
  z-index: 3;
  display: flex;
  min-width: 0;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.88);
  grid-row: 1;
}

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

.chat-brand__avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  box-shadow: 0 7px 18px rgba(167, 43, 105, 0.2);
}

.chat-brand__name {
  overflow: hidden;
  font-size: 18px;
  font-weight: 820;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-brand__status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 12px;
}

.chat-brand__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(39, 169, 107, 0.12);
}

.chat-brand__status.is-busy .chat-brand__status-dot {
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 104, 47, 0.13);
  animation: status-pulse 1.1s ease-in-out infinite;
}

.chat-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header__form {
  margin: 0;
}

.chat-header__button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.chat-header__button:hover {
  border-color: rgba(111, 43, 208, 0.28);
  box-shadow: 0 8px 22px rgba(61, 29, 83, 0.09);
  transform: translateY(-1px);
}

.chat-header__button--quiet {
  color: var(--ink-soft);
  background: transparent;
}

.chat-header__button--workspace {
  display: none;
}

.chat-notice {
  position: relative;
  z-index: 2;
  margin: 12px 16px 0;
  padding: 11px 14px;
  color: #315f48;
  background: #edfff5;
  border: 1px solid rgba(39, 169, 107, 0.2);
  border-radius: 12px;
  font-size: 13px;
  grid-row: 2;
  line-height: 1.4;
}

.chat-notice--error {
  color: #8c2741;
  background: #fff0f3;
  border-color: rgba(196, 49, 89, 0.2);
}

.chat-messages {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 13px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 28px clamp(16px, 4vw, 52px) 24px;
  overscroll-behavior: contain;
  scrollbar-color: rgba(80, 47, 107, 0.2) transparent;
  scrollbar-width: thin;
  grid-row: 3;
}

.chat-history-loader {
  display: inline-flex;
  min-height: 30px;
  align-self: center;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  color: #8a7c93;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  box-shadow: 0 5px 16px rgba(58, 27, 75, 0.05);
}

.chat-history-loader span {
  width: 10px;
  height: 10px;
  border: 2px solid rgba(111, 43, 208, 0.18);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: history-spin 0.7s linear infinite;
}

.chat-empty {
  display: grid;
  width: min(570px, 100%);
  min-width: 0;
  place-items: center;
  margin: auto;
  padding: 28px 8px;
  text-align: center;
}

.chat-empty__mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin-bottom: 17px;
  color: #fff;
  background: linear-gradient(145deg, var(--orange), var(--pink) 58%, var(--purple));
  border-radius: 21px;
  box-shadow: 0 16px 32px rgba(218, 47, 99, 0.24);
  font-size: 30px;
  font-weight: 900;
  transform: rotate(-5deg);
}

.chat-empty h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.chat-empty > p {
  max-width: 430px;
  margin: 11px 0 22px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chat-suggestions button {
  min-height: 39px;
  padding: 0 14px;
  color: #5f387d;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(111, 43, 208, 0.16);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  transition: background 150ms ease, transform 150ms ease;
}

.chat-suggestions button:hover {
  background: #fff;
  transform: translateY(-1px);
}

.chat-message {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  animation: message-in 180ms ease-out both;
}

.chat-message--user {
  align-items: flex-end;
}

.chat-message__bubble {
  position: relative;
  max-width: min(79%, 680px);
  min-width: 74px;
  padding: 12px 15px 25px;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px 20px 20px;
  box-shadow: 0 7px 25px rgba(58, 27, 75, 0.065);
}

.chat-message--user .chat-message__bubble {
  color: #fff;
  background: linear-gradient(135deg, #ff7637, #f63d6b 62%, #b42faf);
  border: 0;
  border-radius: 20px 7px 20px 20px;
  box-shadow: 0 9px 25px rgba(219, 50, 100, 0.17);
}

.chat-message__text {
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.52;
  white-space: pre-wrap;
}

.chat-message__text b {
  font-weight: 800;
}

.chat-message__attachments {
  display: grid;
  gap: 8px;
  margin: -7px -10px 9px;
}

.chat-message__attachments:only-child {
  margin-bottom: -8px;
}

.chat-message__image-link {
  display: block;
  overflow: hidden;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.24);
}

.chat-message__image {
  display: block;
  width: min(360px, 100%);
  max-height: 420px;
  object-fit: cover;
}

.chat-message__audio {
  display: block;
  width: min(320px, 68vw);
  height: 42px;
  border-radius: 999px;
}

.chat-message__processing {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 680;
}

.chat-message--assistant .chat-message__processing {
  color: var(--ink-soft);
}

.chat-message__processing > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: status-pulse 1s ease-in-out infinite;
}

.chat-message__processing--failed {
  color: #ffe0e7;
}

.chat-message__time {
  position: absolute;
  right: 12px;
  bottom: 8px;
  color: rgba(52, 34, 66, 0.44);
  font-size: 10px;
  line-height: 1;
}

.chat-message--user .chat-message__time {
  color: rgba(255, 255, 255, 0.69);
}

.chat-message__actions {
  display: flex;
  max-width: min(79%, 680px);
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.chat-message--assistant .chat-message__actions {
  padding: 8px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(111, 43, 208, 0.12);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(66, 28, 91, 0.07);
}

.chat-message__actions form {
  margin: 0;
}

.chat-action-form--primary {
  flex-basis: 100%;
}

.chat-action-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: #63328b;
  background: #fff;
  border: 1px solid rgba(111, 43, 208, 0.2);
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 5px 16px rgba(66, 28, 91, 0.06);
  transition: border-color 150ms ease, transform 150ms ease;
}

.chat-action-button--primary {
  width: 100%;
  min-width: 180px;
  color: #fff;
  background: linear-gradient(135deg, #f52f72, #ff6a32);
  border-color: transparent;
  box-shadow: 0 9px 22px rgba(245, 47, 114, 0.22);
}

.chat-action-button--primary:hover {
  border-color: transparent;
  box-shadow: 0 11px 26px rgba(245, 47, 114, 0.28);
}

.chat-action-button:hover {
  border-color: rgba(245, 47, 114, 0.45);
  transform: translateY(-1px);
}

.chat-action-button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.chat-tool-trace {
  display: flex;
  max-width: min(79%, 680px);
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.chat-tool-trace__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  color: #806e8d;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(64, 34, 94, 0.09);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
}

.chat-tool-trace__item i,
.chat-agent-activity__tools i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}

.chat-tool-trace__item--error i,
.chat-agent-activity__tools .is-error i {
  background: var(--danger);
}

.chat-tool-trace__item--running i,
.chat-agent-activity__tools .is-running i {
  background: var(--orange);
  animation: status-pulse 0.8s ease-in-out infinite;
}

.chat-agent-activity {
  display: flex;
  max-width: min(82%, 700px);
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 9px;
  color: #604b70;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(111, 43, 208, 0.1);
  border-radius: 16px;
  box-shadow: 0 7px 20px rgba(58, 27, 75, 0.05);
}

.chat-agent-activity__orb {
  display: flex;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: linear-gradient(145deg, rgba(255, 104, 47, 0.16), rgba(111, 43, 208, 0.14));
  border-radius: 12px;
}

.chat-agent-activity__orb i {
  width: 4px;
  height: 4px;
  background: var(--pink);
  border-radius: 50%;
  animation: thinking 1.1s ease-in-out infinite;
}

.chat-agent-activity__orb i:nth-child(2) {
  animation-delay: 120ms;
}

.chat-agent-activity__orb i:nth-child(3) {
  animation-delay: 240ms;
}

.chat-agent-activity strong {
  display: block;
  font-size: 12px;
  font-weight: 750;
}

.chat-agent-activity__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 3px;
}

.chat-agent-activity__tools:empty {
  display: none;
}

.chat-agent-activity__tools span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #988ba2;
  font-size: 10px;
}

.chat-toast {
  position: absolute;
  right: 410px;
  bottom: 92px;
  left: 16px;
  z-index: 10;
  padding: 10px 13px;
  color: #8c2741;
  background: #fff0f3;
  border: 1px solid rgba(196, 49, 89, 0.2);
  border-radius: 11px;
  box-shadow: 0 8px 30px rgba(90, 28, 59, 0.12);
  font-size: 13px;
}

.chat-toast.is-success {
  color: #276a48;
  background: #effaf3;
  border-color: rgba(39, 169, 107, 0.2);
}

.chat-composer-wrap {
  position: relative;
  z-index: 3;
  min-width: 0;
  padding: 10px clamp(12px, 3vw, 28px) 9px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.94);
  grid-row: 4;
}

.chat-composer {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  gap: 5px;
  padding: 7px;
  background: #fff;
  border: 1px solid rgba(66, 35, 87, 0.15);
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(60, 29, 79, 0.07);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.chat-composer:focus-within {
  border-color: rgba(245, 47, 114, 0.38);
  box-shadow: 0 9px 28px rgba(160, 37, 104, 0.11);
}

.chat-composer textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  max-height: 150px;
  resize: none;
  padding: 10px 5px 8px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  line-height: 1.45;
}

.chat-composer textarea::placeholder {
  color: #a29aa9;
}

.chat-composer__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 2px;
}

.chat-composer__tool {
  display: grid;
  width: 39px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: #7e6b8a;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}

.chat-composer__tool:hover {
  color: var(--pink);
  background: rgba(245, 47, 114, 0.07);
}

.chat-composer__tool svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.chat-send {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--orange), var(--pink));
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(235, 50, 99, 0.24);
  transition: filter 150ms ease, transform 150ms ease;
}

.chat-send:hover {
  filter: saturate(1.08);
  transform: translateY(-1px);
}

.chat-send:disabled {
  cursor: wait;
  filter: grayscale(0.35);
  opacity: 0.65;
  transform: none;
}

.chat-send svg {
  width: 22px;
  height: 22px;
  transform: translate(-1px, -1px);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chat-composer__hint {
  margin: 6px 0 0;
  color: #aaa1b0;
  font-size: 10px;
  text-align: center;
}

.chat-attachment-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 7px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 5px 17px rgba(60, 29, 79, 0.05);
}

.chat-attachment-preview > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.chat-attachment-preview img {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 10px;
}

.chat-attachment-preview audio {
  width: min(260px, 54vw);
  height: 38px;
}

.chat-attachment-preview strong,
.chat-attachment-preview span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment-preview strong {
  font-size: 12px;
}

.chat-attachment-preview span {
  max-width: 220px;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.chat-attachment-preview > button {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  color: #8c7d96;
  background: #f8f3f8;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 20px;
}

.chat-recorder {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 14px;
  background: #fff;
  border: 1px solid rgba(245, 47, 114, 0.22);
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(160, 37, 104, 0.1);
}

.chat-recorder__pulse {
  width: 9px;
  height: 9px;
  background: var(--pink);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(245, 47, 114, 0.1);
  animation: status-pulse 0.8s ease-in-out infinite;
}

.chat-recorder__state {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-recorder strong {
  font-size: 13px;
}

.chat-recorder time {
  margin-right: auto;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.chat-recorder button {
  cursor: pointer;
}

.chat-recorder__cancel {
  padding: 8px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  font-size: 12px;
}

.chat-recorder__send {
  display: flex;
  min-width: 116px;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  color: #fff;
  background: linear-gradient(145deg, var(--orange), var(--pink));
  border: 0;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(235, 50, 99, 0.2);
  font-size: 12px;
  font-weight: 700;
}

.chat-recorder__send svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.workspace-backdrop {
  display: none;
}

.chat-workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(252, 248, 244, 0.94);
  border-left: 1px solid var(--line);
}

.chat-workspace__header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 17px 12px 20px;
  border-bottom: 1px solid var(--line);
}

.chat-workspace__header span,
.chat-workspace__header small {
  display: block;
}

.chat-workspace__header span {
  font-size: 15px;
  font-weight: 800;
}

.chat-workspace__header small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.chat-workspace__header > button {
  display: none;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  font-size: 22px;
}

.chat-workspace__content {
  min-height: 0;
  overflow-y: auto;
  padding: 0 18px 24px;
  overscroll-behavior: contain;
  scrollbar-color: rgba(80, 47, 107, 0.2) transparent;
  scrollbar-width: thin;
}

.workspace-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  margin: 0 -18px 20px;
  padding: 9px 12px;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(252, 248, 244, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(15px);
}

.workspace-tab {
  min-width: 0;
  min-height: 34px;
  padding: 0 5px;
  overflow: hidden;
  color: #8d8096;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 720;
  text-overflow: ellipsis;
}

.workspace-tab.is-active {
  color: #672f8f;
  background: #fff;
  box-shadow: 0 5px 15px rgba(61, 29, 83, 0.08);
}

.workspace-panel {
  animation: panel-in 160ms ease-out both;
}

.workspace-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.workspace-eyebrow {
  margin: 0 0 4px;
  color: var(--pink);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-section-heading h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.nutrition-card {
  padding: 17px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.22), transparent 7rem),
    linear-gradient(145deg, #ff7b3e, #f13d73 62%, #8c35bf);
  border-radius: 19px;
  box-shadow: 0 15px 28px rgba(204, 47, 103, 0.2);
}

.nutrition-card__main {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.nutrition-card__main strong {
  font-size: 34px;
  font-weight: 850;
  letter-spacing: -0.045em;
}

.nutrition-card__main span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

.nutrition-progress {
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
}

.nutrition-progress span {
  display: block;
  height: 100%;
  background: #fff;
  border-radius: inherit;
}

.nutrition-macros {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  grid-template-columns: repeat(3, 1fr);
}

.nutrition-macros > div {
  min-width: 0;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}

.nutrition-macros span,
.nutrition-macros strong {
  display: block;
}

.nutrition-macros span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 8px;
  text-transform: uppercase;
}

.nutrition-macros strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
}

.workspace-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 2px 10px;
}

.workspace-list-heading h3 {
  margin: 0;
  font-size: 13px;
}

.workspace-list-heading span {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  color: var(--ink-soft);
  background: #eee6ef;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 750;
}

.meal-list,
.memory-list,
.diary-days {
  display: grid;
  gap: 8px;
}

.meal-row {
  display: grid;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.meal-row time {
  color: var(--ink-soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.meal-row strong,
.meal-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meal-row strong {
  font-size: 11px;
}

.meal-row span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.meal-row b {
  color: #715d7d;
  font-size: 11px;
}

.workspace-discuss {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  padding: 0 14px;
  color: #713695;
  background: #fff;
  border: 1px solid rgba(111, 43, 208, 0.17);
  border-radius: 13px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  box-shadow: 0 7px 18px rgba(61, 29, 83, 0.05);
}

.workspace-discuss:hover {
  border-color: rgba(245, 47, 114, 0.35);
}

.workspace-discuss--icon {
  width: 36px;
  min-height: 36px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border-radius: 11px;
  font-size: 17px;
}

.workspace-empty {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
}

.workspace-empty span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--pink);
  background: rgba(245, 47, 114, 0.08);
  border-radius: 9px;
}

.workspace-empty p {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.workspace-empty--large {
  min-height: 150px;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.diary-day {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.diary-day > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid var(--line);
}

.diary-day > header strong,
.diary-day > header span {
  display: block;
}

.diary-day > header strong {
  font-size: 12px;
}

.diary-day > header span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.diary-day > header button {
  padding: 6px 8px;
  color: #743995;
  background: #f9f3fb;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
}

.diary-day__meal {
  display: grid;
  gap: 7px;
  padding: 8px 12px;
  grid-template-columns: 33px minmax(0, 1fr) auto;
  color: #675a70;
  font-size: 10px;
}

.diary-day__meal + .diary-day__meal {
  border-top: 1px solid rgba(64, 34, 94, 0.07);
}

.diary-day__meal span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-intro {
  margin: -5px 0 16px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.memory-row {
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.memory-row > span {
  color: var(--pink);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.memory-row p {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.45;
}

.profile-telegram {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 12px;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.profile-telegram__icon {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #42b3e9, #2688ce);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 850;
}

.profile-telegram strong,
.profile-telegram span {
  display: block;
}

.profile-telegram strong {
  font-size: 11px;
}

.profile-telegram span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.profile-telegram > i {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: #fff;
  background: var(--success);
  border-radius: 50%;
  font-size: 11px;
  font-style: normal;
}

.profile-facts {
  display: grid;
  gap: 0;
  margin: 15px 0 18px;
  padding: 2px 12px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.profile-facts > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.profile-facts > div + div {
  border-top: 1px solid rgba(64, 34, 94, 0.08);
}

.profile-facts dt,
.profile-facts dd {
  margin: 0;
  font-size: 10px;
}

.profile-facts dt {
  color: var(--ink-soft);
}

.profile-facts dd {
  font-weight: 700;
  text-align: right;
}

.web-access {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 111, 44, 0.2), transparent 30rem),
    radial-gradient(circle at 88% 82%, rgba(153, 41, 193, 0.17), transparent 30rem),
    var(--cream);
}

.web-access__card {
  position: relative;
  width: min(560px, 100%);
  overflow: hidden;
  padding: clamp(28px, 6vw, 52px);
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 32px;
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(20px);
}

.web-access__card::after {
  position: absolute;
  top: -90px;
  right: -90px;
  width: 210px;
  height: 210px;
  background: linear-gradient(145deg, rgba(255, 104, 47, 0.16), rgba(245, 47, 114, 0.08));
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.web-access__avatar {
  position: relative;
  z-index: 1;
  width: 82px;
  height: 82px;
  object-fit: cover;
  border: 3px solid #fff;
  border-radius: 25px;
  box-shadow: 0 14px 30px rgba(176, 45, 111, 0.22);
}

.web-access__eyebrow {
  margin: 20px 0 8px;
  color: var(--pink);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.web-access h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.web-access__lead {
  max-width: 410px;
  margin: 17px auto 28px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.55;
}

.web-access__steps {
  display: grid;
  gap: 9px;
  margin-top: 22px;
  text-align: left;
}

.web-access__steps > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.web-access__steps span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--orange), var(--pink));
  border-radius: 9px;
  font-size: 13px;
  font-weight: 850;
}

.web-access__steps p {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.web-access__security {
  margin: 18px 0 0;
  color: #978e9d;
  font-size: 12px;
  line-height: 1.45;
}

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

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

@keyframes thinking {
  0%, 65%, 100% { opacity: 0.35; transform: translateY(0); }
  32% { opacity: 1; transform: translateY(-3px); }
}

@keyframes status-pulse {
  50% { opacity: 0.4; }
}

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

@media (max-width: 1060px) {
  .chat-app {
    grid-template-columns: minmax(0, 1fr) 350px;
  }

  .chat-toast {
    right: 370px;
  }

  .chat-header__button--quiet .chat-header__button-label {
    display: none;
  }
}

@media (max-width: 900px) {
  .chat-app {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-header__button--workspace {
    display: inline-flex;
  }

  .chat-workspace {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 21;
    width: min(420px, 94vw);
    background: #fcf8f4;
    border-left: 1px solid var(--line);
    box-shadow: -20px 0 50px rgba(47, 23, 61, 0.16);
    transform: translateX(104%);
    transition: transform 220ms ease;
  }

  .chat-app.workspace-open .chat-workspace {
    transform: translateX(0);
  }

  .chat-workspace__header > button {
    display: grid;
  }

  .workspace-backdrop {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: block;
    visibility: hidden;
    padding: 0;
    background: rgba(28, 13, 40, 0.24);
    border: 0;
    cursor: pointer;
    opacity: 0;
    transition: opacity 200ms ease, visibility 200ms ease;
  }

  .chat-app.workspace-open .workspace-backdrop {
    visibility: visible;
    opacity: 1;
  }

  .chat-toast {
    right: 16px;
  }
}

@media (max-width: 640px) {
  .web-chat-page {
    background: var(--paper);
  }

  .chat-app {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .chat-header {
    min-height: 66px;
    gap: 8px;
    padding: 9px 10px;
  }

  .chat-brand {
    gap: 8px;
  }

  .chat-brand__avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .chat-brand__name {
    font-size: 16px;
  }

  .chat-header__actions {
    gap: 5px;
  }

  .chat-header__button {
    width: 38px;
    min-height: 38px;
    padding: 0;
  }

  .chat-header__button-label {
    display: none;
  }

  .chat-messages {
    padding: 18px 11px 16px;
  }

  .chat-empty {
    width: 100%;
    max-width: 100%;
  }

  .chat-empty h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: clamp(26px, 8vw, 32px);
  }

  .chat-empty > p,
  .chat-suggestions {
    width: 100%;
    max-width: 100%;
  }

  .chat-message__bubble,
  .chat-message__actions,
  .chat-tool-trace {
    max-width: 89%;
  }

  .chat-message__text {
    font-size: 14px;
  }

  .chat-agent-activity {
    max-width: 92%;
  }

  .chat-composer-wrap {
    padding: 8px 8px max(7px, env(safe-area-inset-bottom));
  }

  .chat-composer {
    gap: 2px;
    padding: 6px;
  }

  .chat-composer__actions {
    gap: 0;
  }

  .chat-composer__tool {
    width: 35px;
  }

  .chat-composer textarea {
    padding-right: 2px;
    padding-left: 2px;
  }

  .chat-composer__hint {
    display: none;
  }

  .chat-toast {
    bottom: 78px;
  }

  .chat-workspace {
    width: 100%;
  }

  .web-access {
    padding: 14px;
  }

  .web-access__card {
    padding: 30px 20px;
    border-radius: 25px;
  }
}

@media (max-width: 390px) {
  .chat-brand__status {
    font-size: 10px;
  }

  .chat-message__bubble {
    max-width: 92%;
  }

  .chat-attachment-preview audio {
    width: 195px;
  }
}

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