body {
  --ink: #101d38;
  --muted: #465b7d;
  --panel: #f8faff;
  --accent: #2058d5;
  --accent-soft: #e2edff;
  --workspace-line: #e0e8f5;
  --workspace-blue: #1355db;
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  background: #edf2fb;
}

.page {
  max-width: none;
  padding: 0;
  animation: none;
}

.workspace-icons {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-header {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 43px);
  padding-right: clamp(16px, 3.2vw, 54px);
  background: linear-gradient(105deg, #edf3fc, #e6edfb);
  flex-shrink: 0;
}

.workspace-brand {
  min-height: 87px;
  width: clamp(250px, 21.2vw, 354px);
  flex: none;
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(120deg, #1c365d, #101d40 82%);
  color: white;
  padding: 8px 46px 9px clamp(20px, 2vw, 34px);
  text-decoration: none;
  border-radius: 0 0 25% 0 / 0 0 32% 0;
  clip-path: polygon(0 0, 100% 0, 93% 100%, 0 100%);
}

.brand-mark {
  width: clamp(43px, 3.6vw, 60px);
  flex: none;
  filter: drop-shadow(0 5px 10px #162f63);
}

.workspace-brand strong,
.workspace-brand small {
  display: block;
  white-space: nowrap;
}

.workspace-brand strong { font-size: clamp(22px, 1.7vw, 27px); letter-spacing: -.04em; }
.workspace-brand small { font-size: clamp(13px, 1.2vw, 18px); color: #d2dcf0; margin-top: 2px; }

.workspace-nav {
  display: flex;
  flex: 1;
  gap: clamp(3px, 1.25vw, 22px);
  align-items: center;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-item,
.workspace-primary,
.workspace-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 13px;
  font: inherit;
  color: inherit;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
}

.nav-item {
  font-size: clamp(14px, 1.3vw, 19px);
  white-space: nowrap;
  padding: 10px clamp(9px, 1.3vw, 22px);
}

.nav-item .ui-icon { color: #344b74; }
.nav-item:hover,
.workspace-secondary:hover:not(:disabled) { background: #e6efff; border-color: #b9cdef; }

.nav-active,
.workspace-primary {
  color: white;
  background: linear-gradient(108deg, #1c65e0, #2349bd);
  box-shadow: inset 0 1px 0 #ffffff30;
}

.nav-active .ui-icon { color: #f2f6ff; }
.nav-active:hover,
.workspace-primary:hover:not(:disabled) { background: linear-gradient(108deg, #1a58c8, #173894); }

.workspace-primary {
  min-height: 50px;
  padding: 10px 21px;
  white-space: nowrap;
  font-weight: 650;
}

#meetingBtn { background: linear-gradient(102deg, #142c7b, #2a59c3); font-size: 18px; }

.workspace-language {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #cad8ec;
  border-radius: 11px;
  background: #f6f9ff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.workspace-secondary {
  min-height: 46px;
  padding: 9px 15px;
  border-color: #cad8ec;
  color: #263d66;
  background: #f6f9ffbe;
  font-weight: 600;
}

.workspace-primary:disabled,
.workspace-secondary:disabled { cursor: default; opacity: .55; }
.workspace-layout [hidden] { display: none; }

.workspace-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(225px, 20.1%) minmax(0, 1fr) minmax(245px, 20.9%);
  background: linear-gradient(112deg, #f3f6fc, #edf3fe);
}

.workspace-sidebar,
.workspace-details {
  min-height: 0;
  min-width: 0;
  overflow: auto;
  scrollbar-width: thin;
  padding: 16px clamp(11px, 1.3vw, 22px);
}

.workspace-sidebar { border-right: 1px solid #e5ecf8; }
.workspace-sidebar h2,
.workspace-card h2 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 14px;
  font-size: clamp(16px, 1.25vw, 20px);
  letter-spacing: -.025em;
}

.workspace-sidebar h2 .ui-icon { color: #315fae; }
.sidebar-section { padding: 12px 0 17px; }
.sidebar-section + .sidebar-section { border-top: 1px solid var(--workspace-line); }
.workspace-sidebar .team-controls { margin: 0; gap: 11px; }
.workspace-sidebar .team-controls select {
  min-height: 54px;
  padding: 0 14px;
  border: 1px solid #cad8ec;
  border-radius: 13px;
  background: #f7faff;
  font-size: 17px;
  font-weight: 650;
}
#teamConfigBtn { background: linear-gradient(110deg, #2269d2, #1d389b); }

.workspace-sidebar .room-list {
  display: block;
  max-height: clamp(133px, 25vh, 232px);
  scrollbar-width: thin;
  padding: 0 2px 0 0;
}

.workspace-sidebar .room-card {
  padding: 9px 10px;
  margin-bottom: 5px;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  box-shadow: none;
  transition: background .15s;
}

.workspace-sidebar .room-card:hover,
.workspace-sidebar .room-card-active {
  transform: none;
  background: #d9e9ff;
}
.workspace-sidebar .room-card-active .room-card-name { color: var(--workspace-blue); }
.workspace-sidebar .room-card-header { margin: 0; row-gap: 3px; }
.workspace-sidebar .room-card-icon { font-size: .95rem; }
.workspace-sidebar .room-card-members { margin: 3px 0 0 21px; font-size: 12px; }
.workspace-sidebar .room-card-count { display: none; }
.workspace-sidebar .room-card-archived { cursor: default; opacity: .8; }
.workspace-sidebar .room-action { font-size: 11px; padding: 3px 4px; }
.workspace-sidebar .archived-rooms { margin-top: 8px; font-size: 13px; }
#rosterCount { color: var(--muted); font-size: .85em; font-weight: 500; }

.workspace-roster,
.workspace-models { list-style: none; padding: 0; margin: 0; }
.workspace-roster {
  max-height: clamp(119px, 22vh, 225px);
  overflow: auto;
  scrollbar-width: thin;
  background: #f7faffb0;
  border: 1px solid #dce6f6;
  border-radius: 14px;
}
.workspace-roster:empty { display: none; }
.workspace-roster li {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 7px 10px;
}
.workspace-roster li + li { border-top: 1px solid #e6edf8; }
.workspace-roster li > div { min-width: 0; }
.workspace-roster strong,
.workspace-roster small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-roster small { margin-top: 3px; color: var(--muted); font-size: 12px; }
#inviteExpertBtn { width: 100%; margin-top: 8px; justify-content: flex-start; background: #e8eff9; border: 0; }

.initial-avatar {
  width: 54px;
  height: 54px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #1d4282;
  background: linear-gradient(155deg, #e9f0fd, #c8d9f8);
  box-shadow: inset 0 0 0 1px #214b9f15;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.03em;
}
.initial-avatar[data-tone="1"] { color: #314988; background: linear-gradient(145deg, #e7edff, #c3ccfa); }
.initial-avatar[data-tone="2"] { color: #195373; background: linear-gradient(145deg, #e1f4ff, #b9def1); }
.initial-avatar[data-tone="3"] { color: #3f477c; background: linear-gradient(145deg, #edf0fb, #ccd4ef); }
.workspace-roster .initial-avatar { width: 40px; height: 40px; font-size: 14px; }

.workspace-conversation {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 16px clamp(12px, 1vw, 17px) 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0 0 18px 18px;
  background: #f6f8fdbb;
}

.meeting-banner {
  min-height: clamp(113px, 14.3vh, 137px);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 16px 18% 16px 23%;
  border-radius: 17px;
  background: #c8e0ff url("meeting-banner.png") 50% 57% / 100% 155% no-repeat;
}
.meeting-banner h1 { margin: 0; font-size: clamp(23px, 2.1vw, 33px); letter-spacing: -.035em; line-height: 1.25; overflow-wrap: anywhere; }
.meeting-banner p { margin: 6px 0 0; color: #314f77; font-size: clamp(13px, 1.15vw, 19px); }

.conversation-toolbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 10px;
  min-height: 69px;
  padding: 7px 9px 0;
  border-bottom: 1px solid var(--workspace-line);
}
.discussion-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  color: #154fce;
  white-space: nowrap;
  font-weight: 750;
  font-size: clamp(14px, 1.25vw, 19px);
}
.discussion-label::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 3px;
  background: #1c5ce2;
}
.conversation-actions { display: flex; align-items: center; gap: 8px; }
.conversation-actions .workspace-secondary { min-height: 39px; font-size: 13px; }
.conversation-actions .ui-icon { color: #286be1; }

.workspace-conversation .chat-log {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
  padding: 21px 14px 16px 12px;
  scrollbar-width: thin;
}
.workspace-conversation .chat-log:empty::before {
  content: attr(data-empty-label);
  margin: auto;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
.workspace-conversation .message {
  width: fit-content;
  max-width: min(100%, 855px);
  display: flex;
  align-items: start;
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
}
.message-main { min-width: 0; }
.workspace-conversation .message .meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 26px;
  margin: 0 0 3px;
  text-transform: none;
  letter-spacing: normal;
}
.message-author { color: var(--ink); font-size: 17px; font-weight: 750; }
.message-model {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  background: #d9e6ff;
  color: #1745a6;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.workspace-conversation .message time { font-size: 12px; color: var(--muted); }
.workspace-conversation .message-content {
  padding: 8px 15px;
  border-radius: 4px 15px 15px 15px;
  background: linear-gradient(115deg, #eef4ff, #e2ebfc);
  font-size: clamp(14px, 1.13vw, 18px);
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.workspace-conversation .message.user { align-self: flex-end; flex-direction: row-reverse; }
.workspace-conversation .message.user .meta { justify-content: flex-end; }
.workspace-conversation .message.user .message-content { background: #d9e9ff; border-radius: 15px 4px 15px 15px; }
.workspace-conversation .system-message { align-self: center; }
.workspace-conversation .system-message .meta { display: none; }
.workspace-conversation .system-message .message-content { color: #4a6084; font-size: 12px; border-radius: 999px; padding: 6px 14px; }

.workspace-conversation .chat-form {
  position: relative;
  min-height: 72px;
  align-items: end;
  margin: 0 6px 0;
  padding: 8px;
  gap: 8px;
  border: 1px solid #e2ebf9;
  border-radius: 19px;
  background: #f8fbff;
  box-shadow: 0 8px 23px #243d7410;
}
.workspace-conversation .chat-form textarea {
  min-width: 0;
  min-height: 51px;
  height: 51px;
  padding: 13px 14px;
  border: 1px solid #d9e5f7;
  border-radius: 13px;
  color: var(--ink);
  background: #fbfdff;
}
.workspace-conversation .chat-form textarea::placeholder { color: #52698e; }
.workspace-conversation .chat-form button {
  display: grid;
  place-items: center;
  width: 57px;
  height: 51px;
  padding: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #626fed, #4157d5);
  color: white;
}
.workspace-conversation .chat-form button .ui-icon { width: 25px; height: 25px; }
.workspace-conversation .chat-form button:disabled { opacity: .55; cursor: default; }

.workspace-details { padding-left: clamp(9px, .85vw, 15px); padding-right: clamp(9px, .85vw, 15px); }
.workspace-card {
  padding: clamp(11px, 1vw, 17px);
  margin-bottom: 14px;
  border-radius: 20px;
  background: linear-gradient(138deg, #f9fbffa6, #f6f9ffe6);
  box-shadow: 0 12px 35px #3548750b;
}
.workspace-card h2 {
  min-height: 41px;
  padding: 4px 0;
  margin: 0 0 7px;
}
.workspace-card h2 .ui-icon { color: #2552a5; }
.meeting-info { margin: 0; }
.meeting-info > div {
  display: grid;
  grid-template-columns: 4.4em minmax(0, 1fr);
  align-items: baseline;
  gap: 7px;
  padding: 10px 4px;
  border-bottom: 1px solid #e9eff8;
  font-size: clamp(13px, 1.07vw, 16px);
}
.meeting-info > div:last-child { border: 0; }
.meeting-info dt { color: #425777; }
.meeting-info dd { margin: 0; overflow-wrap: anywhere; }
.meeting-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #e5edfb;
  color: #304f82;
  white-space: nowrap;
}
.meeting-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #8097be; }
.meeting-status[data-active="true"] { background: #daf4de; color: #236836; }
.meeting-status[data-active="true"]::before { background: #49ad48; }
.workspace-models { max-height: 270px; overflow: auto; scrollbar-width: thin; }
.workspace-models li { display: grid; gap: 4px; padding: 9px 4px; border-bottom: 1px solid #e9eff8; font-size: 14px; }
.workspace-models small { color: var(--muted); overflow-wrap: anywhere; }
.quick-actions .workspace-secondary { width: 100%; margin-top: 8px; min-height: 49px; }
.quick-actions .notes-action { color: #124dca; background: #dbe8ff; border-color: #aec9fc; }

body .modal { background: #17284672; }
body .modal-content { box-shadow: 0 22px 60px #1728464a; }
body #teamDialog::backdrop { background: #17284672; }
body .modal-header { border-bottom-color: #dce7f7; }
body .modal-body input,
body .team-editor select,
body .team-editor textarea,
body .api-key-picker select,
body .api-model-options { border-color: #ccd9ef; }
body .team-invite,
body .team-agent,
body .api-key-row { border-color: #d8e3f5; }

@media (max-width: 1180px) {
  .workspace-header { gap: 12px; }
  .workspace-brand { width: 225px; gap: 11px; padding-right: 35px; }
  .workspace-layout { grid-template-columns: minmax(195px, 22%) minmax(0, 1fr) minmax(195px, 22%); }
  .conversation-actions .workspace-secondary { padding-inline: 8px; }
}

@media (max-width: 940px) {
  html, body { overflow: auto; height: auto; min-height: 100%; }
  .page { height: auto; min-height: 100vh; overflow: visible; }
  .workspace-header { flex-wrap: wrap; padding: 0 14px 9px 0; }
  .workspace-brand { min-height: 65px; }
  .workspace-nav { order: 3; width: 100%; flex: auto; padding-left: 12px; }
  #meetingBtn { margin-left: auto; min-height: 42px; font-size: 15px; }
  .workspace-layout { display: grid; grid-template-columns: minmax(176px, 27%) minmax(0, 1fr); }
  .workspace-sidebar { grid-row: span 2; }
  .workspace-conversation { min-height: 620px; max-height: 78vh; }
  .workspace-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; }
}

@media (max-width: 605px) {
  .workspace-header { column-gap: 5px; }
  .workspace-brand { width: 174px; padding: 5px 20px 5px 9px; gap: 6px; }
  .workspace-brand strong { font-size: 18px; }
  .workspace-brand small { font-size: 10px; }
  .workspace-brand .brand-mark { width: 32px; }
  .workspace-language { min-height: 37px; padding: 4px 3px; font-size: 12px; }
  .workspace-header #meetingBtn,
  .workspace-header .opportunity-save { padding-inline: 6px; gap: 4px; font-size: 12px; }
  .workspace-layout { display: flex; flex-direction: column; }
  .workspace-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px; }
  .sidebar-section { min-width: 0; padding: 6px 0; }
  .sidebar-section + .sidebar-section { border-top: 0; }
  .roster-section { grid-column: 1 / -1; }
  .workspace-roster { display: flex; overflow-x: auto; max-width: 100%; }
  .workspace-roster li { flex: 0 0 135px; }
  .workspace-roster li + li { border-top: 0; border-left: 1px solid #e6edf8; }
  #inviteExpertBtn { width: auto; min-height: 37px; }
  .workspace-sidebar .room-list { max-height: 121px; }
  .workspace-conversation { min-height: 560px; padding: 9px; }
  .conversation-toolbar { min-height: 53px; padding-inline: 1px; }
  .discussion-label { padding-inline: 4px; gap: 4px; font-size: 13px; }
  .conversation-actions { gap: 3px; }
  .conversation-actions .workspace-secondary { font-size: 11px; padding-inline: 5px; min-height: 35px; }
  .meeting-banner { padding: 13px 17%; background-size: 114% 133%; }
  .meeting-banner h1 { font-size: 23px; }
  .workspace-conversation .chat-log { padding: 14px 3px; }
  .workspace-conversation .message { gap: 8px; }
  .workspace-conversation .initial-avatar { width: 36px; height: 36px; font-size: 12px; }
  .workspace-conversation .chat-form { margin-inline: 0; }
}

