:root {
  --bg: #eef3fb;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #ffffff;
  --line: rgba(152, 170, 201, 0.22);
  --text: #1f2a44;
  --muted: #8e9ab0;
  --brand: #3f76ff;
  --brand-deep: #2957d1;
  --sidebar-top: #3e6fc0;
  --sidebar-bottom: #5c84d3;
  --danger: #ff4d4f;
  --warn: #ff8a34;
  --shadow: 0 24px 60px rgba(43, 74, 131, 0.16);
  --radius: 26px;
  --radius-sm: 18px;
  --font:
    "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(111, 151, 255, 0.28), transparent 24%),
    radial-gradient(circle at right 20%, rgba(152, 211, 255, 0.18), transparent 18%),
    linear-gradient(180deg, #f7faff 0%, #edf3fb 100%);
}

body {
  min-height: 100vh;
  padding: 18px;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 90px 1fr;
  height: calc(100vh - 36px);
  height: calc(100dvh - 36px);
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 30px;
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  padding: 18px 14px;
  background: linear-gradient(180deg, var(--sidebar-top), var(--sidebar-bottom));
}

.sidebar__traffic {
  display: flex;
  gap: 10px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.dot--red {
  background: #ff5f57;
}

.dot--yellow {
  background: #febc2e;
}

.dot--green {
  background: #28c840;
}

.sidebar__avatar img,
.message-avatar,
.conversation-item img {
  object-fit: cover;
}

.sidebar__avatar {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 10px 22px rgba(18, 44, 95, 0.22);
}

.sidebar__avatar img {
  width: 100%;
  height: 100%;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.nav-item,
.sidebar__settings {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.88);
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.nav-item:hover,
.sidebar__settings:hover,
.icon-btn:hover,
.app-tile:hover {
  transform: translateY(-1px);
}

.nav-item--active {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-item__icon {
  font-size: 27px;
}

.nav-item__badge {
  position: absolute;
  top: 10px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
}

.nav-item__badge--small {
  min-width: 10px;
  width: 10px;
  height: 10px;
  padding: 0;
}

.sidebar__settings {
  margin-top: auto;
  font-size: 28px;
}

.main-panel {
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.view {
  display: none;
  height: 100%;
  min-height: 0;
}

.view--active {
  display: block;
}

.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100%;
  min-height: 0;
}

.main-panel[data-active-view="cec"] .chat-layout {
  grid-template-columns: 340px 1fr;
}

.chat-list-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.chat-list-shell[hidden],
.cec-sidebar[hidden] {
  display: none !important;
}

.cec-sidebar {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(248, 250, 255, 0.96), rgba(239, 244, 255, 0.98)),
    radial-gradient(circle at top left, rgba(113, 159, 255, 0.16), transparent 42%);
}

.main-panel[data-active-view="cec"] .chat-list-shell {
  display: none;
}

.main-panel[data-active-view="cec"] .cec-sidebar {
  display: flex;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.56);
  border-right: 1px solid var(--line);
}

.conversation-list--cec {
  background:
    linear-gradient(180deg, rgba(248, 250, 255, 0.96), rgba(239, 244, 255, 0.98)),
    radial-gradient(circle at top left, rgba(113, 159, 255, 0.16), transparent 42%);
}

.conversation-list__topbar,
.workspace-header,
.thread-header,
.composer {
  backdrop-filter: blur(14px);
}

.conversation-list__topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 16px;
  height: 58px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(163, 178, 205, 0.34);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.search--compact {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  background: #f4f6fb;
  box-shadow: none;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search input::placeholder,
.conversation-item__preview,
.thread-header p,
.message-stream__time,
.workspace-tabs__item,
.conversation-tabs__item {
  color: var(--muted);
}

.search__icon {
  color: #96a4bf;
  font-size: 20px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #6f7b92;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(175, 191, 216, 0.24);
}

.conversation-alert {
  padding: 12px 16px;
  color: #ff7a00;
  background: rgba(255, 153, 61, 0.12);
  border-bottom: 1px solid rgba(255, 153, 61, 0.2);
  font-weight: 600;
}

.conversation-tabs {
  display: flex;
  gap: 24px;
  padding: 14px 16px 0;
  border-bottom: 1px solid var(--line);
}

.conversation-tabs__item {
  position: relative;
  padding: 0 0 12px;
  font-weight: 600;
}

.conversation-tabs__item--active,
.workspace-tabs__item--active {
  color: var(--brand);
}

.conversation-tabs__item--active::after,
.workspace-tabs__item--active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px;
  background: var(--brand);
}

.conversation-items {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.cec-sidebar__top {
  display: grid;
  gap: 18px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(184, 198, 226, 0.42);
}

.cec-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cec-sidebar__brand-icon {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  font-size: 24px;
  color: #fff;
  background: linear-gradient(180deg, #6d98ff, #4a68de);
  box-shadow: 0 14px 28px rgba(68, 102, 194, 0.2);
}

.cec-sidebar__brand-copy {
  display: grid;
  gap: 4px;
}

.cec-sidebar__brand-copy strong {
  font-size: 18px;
}

.cec-sidebar__brand-copy span {
  color: #7c8aa3;
  font-size: 13px;
}

.cec-history {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px 14px;
}

.cec-history__group + .cec-history__group {
  margin-top: 18px;
}

.cec-history__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px 10px;
  color: #67758e;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.cec-history__toggle-icon {
  transition: transform 180ms ease;
}

.cec-history__toggle[aria-expanded="false"] .cec-history__toggle-icon {
  transform: rotate(-90deg);
}

.cec-history__items {
  display: grid;
  gap: 8px;
}

.cec-history__items[hidden] {
  display: none;
}

.cec-history__item {
  width: 100%;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  padding: 12px 12px 12px 10px;
  text-align: left;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid transparent;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.cec-history__item:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(101, 141, 236, 0.3);
}

.cec-history__item--active {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(94, 133, 229, 0.4);
  box-shadow: 0 14px 28px rgba(82, 112, 186, 0.12);
}

.cec-history__item-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  font-size: 14px;
  color: #4366c6;
  background: rgba(87, 124, 226, 0.12);
}

.cec-history__item-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.cec-history__item-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: #25324a;
}

.cec-history__item-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7c8aa3;
  font-size: 12px;
}

.cec-sidebar__footer {
  padding: 14px 12px 18px;
  border-top: 1px solid rgba(184, 198, 226, 0.42);
}

.cec-profile-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 247, 255, 0.94));
  border: 2px solid rgba(84, 120, 220, 0.5);
  box-shadow: 0 14px 28px rgba(74, 102, 168, 0.12);
}

.cec-profile-card__avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
}

.cec-profile-card__meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cec-profile-card__meta strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.cec-profile-card__meta span {
  color: #7b89a1;
  font-size: 12px;
  line-height: 1.4;
}

.cec-profile-card__actions {
  display: flex;
  gap: 8px;
}

.cec-profile-card__action {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: #4366c6;
  background: rgba(84, 120, 220, 0.1);
}

.conversation-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(185, 198, 221, 0.16);
  transition: background 180ms ease;
}

.conversation-item:hover,
.conversation-item--active {
  background: rgba(75, 121, 255, 0.08);
}

.conversation-item img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex: 0 0 auto;
}

.conversation-item__content {
  min-width: 0;
  flex: 1;
}

.conversation-item__row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.conversation-item__meta {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 54px;
}

.conversation-item__time {
  font-style: normal;
  color: #98a2b5;
  line-height: 1.2;
}

.conversation-item__preview {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item__stack {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.conversation-item__stack strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item__tag {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--brand);
  background: rgba(63, 118, 255, 0.12);
}

.conversation-item__tag--ai {
  color: #00a0b6;
  background: rgba(40, 191, 215, 0.14);
}

.conversation-item__pin {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--brand);
  background: rgba(63, 118, 255, 0.08);
  border-radius: 999px;
  padding: 4px 7px;
}

.conversation-item__badges {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
}

.pill--danger {
  color: #fff;
  background: var(--danger);
}

.chat-thread {
  display: grid;
  grid-template-rows: auto 1fr 172px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(245, 248, 255, 0.8), rgba(241, 245, 253, 0.94)),
    radial-gradient(circle at center, rgba(91, 125, 215, 0.05), transparent 42%);
}

.thread-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 88px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.main-panel[data-active-view="cec"] .chat-thread {
  background:
    linear-gradient(180deg, rgba(251, 253, 255, 0.98), rgba(245, 248, 255, 0.98)),
    radial-gradient(circle at top right, rgba(113, 157, 255, 0.14), transparent 26%);
}

.main-panel[data-active-view="cec"] .thread-header {
  min-height: 96px;
  padding: 20px 28px 18px;
  background: rgba(255, 255, 255, 0.68);
}

.main-panel[data-active-view="cec"] .message-stream {
  padding: 34px 32px 22px;
}

.main-panel[data-active-view="cec"] .composer {
  padding: 12px 24px 18px;
  background: rgba(255, 255, 255, 0.72);
}

.thread-header__meta {
  min-width: 0;
  flex: 1;
}

.thread-header__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.thread-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  color: #0f8ca3;
  background: rgba(54, 193, 218, 0.14);
}

.thread-header h1,
.workspace-tabs__item,
.app-group h2 {
  margin: 0;
}

.thread-header h1 {
  font-size: 24px;
  line-height: 1.2;
}

.thread-header p {
  margin: 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.message-stream {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 26px 20px 18px;
}

.message-stream__time {
  text-align: center;
  margin: 14px 0 18px;
  font-size: 14px;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.message-row--assistant {
  justify-content: flex-start;
}

.message-row--self {
  justify-content: flex-end;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.message-card {
  max-width: min(520px, 72%);
  padding: 16px 18px;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(173, 191, 221, 0.24);
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 10px 30px rgba(105, 140, 219, 0.08);
}

.message-row--self .message-card {
  background: linear-gradient(180deg, #e8f1ff 0%, #dceafe 100%);
  border: 1px solid rgba(115, 156, 255, 0.24);
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 10px 30px rgba(105, 140, 219, 0.15);
}

.message-card--image {
  padding: 10px;
}

.message-card--image img {
  display: block;
  width: 160px;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
}

.message-card--snippet span {
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
  font-size: 15px;
}

.message-card--snippet strong {
  color: #47bf6b;
  font-size: 18px;
}

.message-card--snippet em {
  font-style: normal;
  color: #ff5a5f;
  font-size: 18px;
}

.message-card--assistant {
  max-width: min(620px, 80%);
}

.message-card--tool {
  max-width: min(580px, 80%);
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(245, 251, 255, 0.98), rgba(234, 245, 255, 0.98));
  border: 1px solid rgba(96, 186, 216, 0.22);
}

.message-card--panel {
  max-width: min(680px, 86%);
  padding: 18px;
  border-radius: 22px;
}

.intent-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #0b89a2;
  background: rgba(41, 193, 219, 0.12);
}

.assistant-note {
  color: #627089;
}

.tool-card {
  display: grid;
  gap: 14px;
}

.tool-card__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
}

.tool-card__summary::-webkit-details-marker {
  display: none;
}

.tool-card__summary-text {
  font-weight: 800;
  color: #178b62;
}

.tool-card--skill .tool-card__summary-text {
  color: #466cff;
}

.tool-card__summary-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(63, 118, 255, 0.12);
}

.tool-card__summary-toggle::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 7px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--brand);
  transition: transform 180ms ease;
}

.tool-card[open] .tool-card__summary-toggle::before {
  transform: rotate(180deg);
}

.tool-card__body {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(161, 186, 227, 0.34);
}

.tool-card__section {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(179, 202, 235, 0.42);
}

.tool-card__section-title {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0a90a6;
}

.tool-card__rows {
  display: grid;
  gap: 10px;
}

.tool-card__row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
}

.tool-card__label {
  color: #7e8ba2;
  font-size: 13px;
}

.tool-card__value {
  font-weight: 600;
  color: #3a4761;
}

.tool-card--skill .tool-card__summary-toggle {
  background: rgba(70, 108, 255, 0.12);
}

.skill-card__section {
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.92), rgba(242, 246, 255, 0.96));
}

.skill-card__step-name {
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 800;
  color: #314b9f;
}

.approval-card__list {
  margin: 0;
  padding-left: 18px;
  color: #627089;
}

.approval-card__list li + li {
  margin-top: 6px;
}

.flow-form {
  display: grid;
  gap: 14px;
}

.flow-form__tip {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(63, 118, 255, 0.06);
  color: #5a6984;
  font-size: 14px;
}

.flow-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.flow-field {
  display: grid;
  gap: 8px;
}

.flow-field--full {
  grid-column: 1 / -1;
}

.flow-field label {
  font-size: 13px;
  font-weight: 700;
  color: #627089;
}

.flow-field select,
.flow-field input,
.flow-field textarea {
  width: 100%;
  border: 1px solid rgba(180, 196, 220, 0.6);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(248, 251, 255, 0.96);
  color: var(--text);
  outline: none;
}

.flow-field textarea {
  min-height: 88px;
  resize: vertical;
}

.flow-field__hint {
  color: #8a95ab;
  font-size: 12px;
}

.flow-field__suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(63, 118, 255, 0.06);
}

.flow-field__suggestion-text {
  color: #627089;
  font-size: 13px;
}

.quick-fill-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  background: rgba(63, 118, 255, 0.12);
  border: 1px solid rgba(63, 118, 255, 0.18);
}

.flow-form__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.flow-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: #4d5d7b;
  background: rgba(239, 244, 253, 0.92);
  border: 1px solid rgba(177, 192, 220, 0.32);
}

.flow-form__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.flow-form__error {
  color: #d93b45;
  font-size: 13px;
  font-weight: 600;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 124px;
  height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 700;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(180deg, #4b87ff, #3165e4);
  box-shadow: 0 12px 24px rgba(49, 101, 228, 0.24);
}

.secondary-btn {
  color: var(--brand);
  background: rgba(63, 118, 255, 0.08);
  border: 1px solid rgba(63, 118, 255, 0.18);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.56;
  cursor: default;
  box-shadow: none;
}

.approval-card {
  display: grid;
  gap: 18px;
}

.selection-panel {
  display: grid;
  gap: 14px;
}

.selection-panel__title {
  font-size: 18px;
  font-weight: 800;
}

.selection-panel__subtitle {
  color: #627089;
}

.selection-group {
  display: grid;
  gap: 10px;
}

.selection-group__title {
  font-size: 14px;
  font-weight: 800;
  color: #566681;
}

.selection-stack {
  display: grid;
  gap: 10px;
}

.selection-option {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(178, 193, 219, 0.5);
  background: rgba(255, 255, 255, 0.94);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.selection-option:hover {
  transform: translateY(-1px);
  border-color: rgba(92, 134, 231, 0.42);
}

.selection-option--selected {
  border-color: rgba(63, 118, 255, 0.42);
  background: linear-gradient(180deg, rgba(243, 248, 255, 0.98), rgba(233, 242, 255, 0.98));
  box-shadow: 0 12px 24px rgba(80, 126, 224, 0.12);
}

.selection-option:disabled {
  cursor: default;
}

.selection-option__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.selection-option__title {
  font-size: 15px;
}

.selection-option__price {
  color: var(--brand);
  font-weight: 800;
}

.selection-option__sub {
  margin-bottom: 8px;
  color: #5f6f8a;
  font-size: 14px;
}

.selection-option__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #6a7890;
  font-size: 13px;
}

.selection-option__badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(63, 118, 255, 0.08);
  color: var(--brand);
  font-weight: 700;
}

.approval-card__section {
  border: 1px solid rgba(222, 228, 240, 0.9);
  border-radius: 18px;
  overflow: hidden;
}

.approval-card__section-title {
  padding: 12px 16px;
  font-weight: 700;
  color: #596782;
  background: rgba(245, 247, 252, 0.92);
}

.approval-card__row {
  display: grid;
  grid-template-columns: 124px 1fr;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(231, 236, 244, 0.92);
}

.approval-card__row:first-of-type {
  border-top: 0;
}

.approval-card__label {
  color: #7e8ba2;
}

.approval-card__value {
  font-weight: 600;
}

.approval-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding-top: 8px;
  border-top: 1px dashed rgba(193, 205, 226, 0.7);
}

.status-card {
  display: grid;
  gap: 10px;
}

.status-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #1d8f52;
}

.status-card__icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, #5dcf8c, #2eaa63);
}

.status-card__meta {
  color: #5e6d87;
}

.composer {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 10px 18px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.mention-menu {
  position: absolute;
  left: 18px;
  bottom: calc(100% - 2px);
  z-index: 4;
  width: min(244px, calc(100% - 36px));
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(177, 190, 214, 0.88);
  box-shadow: 0 14px 32px rgba(35, 54, 91, 0.24);
  backdrop-filter: blur(14px);
}

.mention-menu::after {
  content: "";
  position: absolute;
  left: 58px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid rgba(177, 190, 214, 0.88);
  border-bottom: 1px solid rgba(177, 190, 214, 0.88);
  transform: rotate(45deg);
}

.mention-menu[hidden] {
  display: none;
}

.mention-menu__item {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 8px;
  text-align: left;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.mention-menu__item:hover {
  transform: translateY(-1px);
  border-color: rgba(209, 214, 224, 0.8);
  background: rgba(244, 246, 250, 0.96);
}

.mention-menu__avatar {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 8px 18px rgba(76, 101, 158, 0.14);
}

.mention-menu__avatar--blue {
  background: linear-gradient(180deg, #71a1ff, #4d73e3);
}

.mention-menu__avatar--cyan {
  background: linear-gradient(180deg, #54cfe8, #2397ca);
}

.mention-menu__avatar--orange {
  background: linear-gradient(180deg, #ffba63, #f38a32);
}

.mention-menu__avatar--green {
  background: linear-gradient(180deg, #61c9a8, #3f9b7d);
}

.mention-menu__copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mention-menu__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: #1f2a44;
}

.mention-menu__desc {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #74819a;
  font-size: 12px;
  line-height: 1.4;
}

.composer__tools {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.composer textarea {
  width: 100%;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 18px;
  color: var(--text);
}

.composer--disabled {
  background: rgba(245, 247, 252, 0.72);
}

.composer--disabled .composer__tools {
  opacity: 0.55;
}

.composer--disabled textarea {
  color: #97a4ba;
}

.workspace-shell {
  display: grid;
  grid-template-rows: 94px 1fr;
  height: 100%;
  min-height: 0;
  background: linear-gradient(180deg, rgba(251, 253, 255, 0.9), rgba(243, 247, 255, 0.95));
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 12px;
}

.workspace-tabs {
  display: flex;
  gap: 36px;
}

.workspace-tabs__item {
  position: relative;
  padding: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
}

.dot-indicator {
  position: absolute;
  top: -4px;
  right: -12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.workspace-content {
  min-height: 0;
  overflow: auto;
  padding: 8px 24px 28px;
}

.app-group {
  padding: 22px 28px 28px;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(207, 218, 238, 0.4);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(96, 124, 174, 0.08);
}

.app-group h2 {
  font-size: 20px;
  margin-bottom: 24px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px 24px;
}

.app-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 620px;
}

.app-grid--single {
  grid-template-columns: 220px;
}

.app-tile {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 86px;
  padding: 12px 10px;
  text-align: left;
  border-radius: 18px;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.app-tile:hover {
  background: rgba(74, 123, 255, 0.06);
}

.app-tile__content {
  display: grid;
  gap: 4px;
}

.app-tile__content strong {
  font-size: 18px;
}

.app-tile__content small {
  color: #8995ab;
  font-size: 13px;
}

.app-tile__icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 26px;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(85, 122, 198, 0.16);
}

.app-tile__icon--avatar {
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.app-tile__icon--avatar img {
  display: block;
  width: 100%;
  height: 100%;
}

.app-tile__icon--cyan {
  background: linear-gradient(180deg, #68d4ff, #32b1ff);
}

.app-tile__icon--blue,
.app-tile__icon--indigo {
  background: linear-gradient(180deg, #6d97ff, #4569df);
}

.app-tile__icon--sky {
  background: linear-gradient(180deg, #61bbe8, #4b88d8);
}

.app-tile__icon--green {
  background: linear-gradient(180deg, #59c9ad, #33a48b);
}

.app-tile__icon--white {
  color: #2b63bf;
  background: linear-gradient(180deg, #ffffff, #f1f6ff);
  border: 1px solid rgba(171, 190, 225, 0.42);
}

.app-tile__icon--orange {
  background: linear-gradient(180deg, #ffab48, #ff7c30);
}

.app-tile__icon--amber {
  background: linear-gradient(180deg, #ffbd5d, #ffa13d);
}

@media (max-width: 1180px) {
  .chat-layout {
    grid-template-columns: 290px 1fr;
  }

  .main-panel[data-active-view="cec"] .chat-layout {
    grid-template-columns: 300px 1fr;
  }

  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-form__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body {
    padding: 0;
  }

  .app-shell {
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    grid-template-columns: 78px 1fr;
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }

  .conversation-list {
    display: none;
  }

  .workspace-header {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-actions {
    justify-content: space-between;
  }

  .app-grid,
  .app-grid--two,
  .app-grid--single {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .approval-card__row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tool-card__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .selection-option__top {
    flex-direction: column;
    align-items: flex-start;
  }

  .flow-field__suggestion {
    flex-direction: column;
    align-items: flex-start;
  }
}
