:root {
  --app-bg: #eef1f8;
  --topbar: #4f52b2;
  --rail: #ebedf5;
  --pane: #f7f8fc;
  --surface: #ffffff;
  --surface-soft: #f6f7fb;
  --line: #dde2ee;
  --ink: #1f2430;
  --muted: #616776;
  --accent: #5b5fc7;
  --accent-soft: #e6e8fb;
  --success: #107c41;
  --warning: #9a6700;
  --danger: #c4314b;
  --shadow: 0 10px 26px rgba(30, 34, 48, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background: var(--app-bg);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 16%, rgba(91, 95, 199, 0.16), transparent 22%),
    linear-gradient(180deg, #eef1f8 0%, #e5eaf5 100%);
}

.login-frame {
  width: min(100%, 1040px);
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 0.52fr) minmax(360px, 0.48fr);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 54px rgba(31, 36, 48, 0.14);
  overflow: hidden;
}

.login-aside {
  padding: 34px;
  background:
    radial-gradient(circle at 18% 14%, rgba(91, 95, 199, 0.22), transparent 22%),
    linear-gradient(180deg, #eff2fb 0%, #e7ebf8 100%);
  border-right: 1px solid var(--line);
}

.login-panel {
  padding: 34px;
  background: rgba(255, 255, 255, 0.98);
  border-left: 3px solid var(--accent);
  box-shadow: inset 0 0 0 1px rgba(91, 95, 199, 0.12);
}

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

.login-brand strong {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-kicker {
  margin: 18px 0 0;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.login-aside h1 {
  margin: 8px 0 0;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 0.96;
}

.login-copy {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 40ch;
}

.login-feature-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.login-feature-list article {
  padding: 14px 16px;
  border: 1px solid #d6ddef;
  background: rgba(255, 255, 255, 0.52);
}

.login-feature-list span {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-feature-list strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.login-form-head h2 {
  margin: 8px 0 0;
  font-size: 2rem;
}

.login-form {
  margin-top: 18px;
}

.login-error {
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px solid #f1c5cf;
  background: #fff1f4;
  color: var(--danger);
  font-size: 0.92rem;
}

.login-submit {
  width: 100%;
  margin-top: 16px;
}

button,
input,
textarea {
  font: inherit;
}

.teams-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 48px 1fr;
}

.teams-topbar {
  display: grid;
  grid-template-columns: 320px 1fr 260px;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  background: var(--topbar);
  color: #fff;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logout-form {
  margin: 0;
}

.logout-button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-left strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.topbar-label {
  font-size: 0.78rem;
  opacity: 0.88;
}

.topbar-separator {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.22);
}

.teams-mark {
  display: grid;
  grid-template-columns: repeat(2, 10px);
  grid-template-rows: repeat(2, 10px);
  gap: 2px;
}

.teams-mark span {
  background: rgba(255, 255, 255, 0.95);
}

.teams-mark span:first-child {
  border-radius: 2px 0 0 0;
}

.topbar-center {
  display: flex;
  justify-content: center;
}

.topbar-search {
  width: min(100%, 520px);
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
}

.topbar-badge {
  min-height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-badge[data-state="connected"] {
  background: rgba(16, 124, 65, 0.22);
}

.topbar-badge[data-state="pending"] {
  background: rgba(255, 200, 87, 0.22);
}

.topbar-badge[data-state="error"] {
  background: rgba(196, 49, 75, 0.22);
}

.teams-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 68px 300px minmax(0, 1fr) 320px;
}

.teams-rail {
  background: var(--rail);
  border-right: 1px solid var(--line);
  padding: 10px 8px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.rail-item {
  border: 0;
  background: transparent;
  color: #4c5365;
  padding: 10px 6px;
  display: grid;
  justify-items: center;
  gap: 6px;
  border-radius: 8px;
  cursor: pointer;
}

.rail-item.is-active {
  background: #dfe3f7;
  color: #2e3242;
}

.rail-glyph {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #cfd5ef;
  font-size: 0.8rem;
  font-weight: 700;
}

.rail-item span:last-child {
  font-size: 0.68rem;
}

.teams-leftpane,
.teams-rightpane {
  background: var(--pane);
  border-right: 1px solid var(--line);
  padding: 18px 16px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.teams-rightpane {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.pane-kicker,
.card-headline span,
.message-tag,
.message-meta,
.empty-state .eyebrow,
.composer-hints span:last-child,
.info-list article span {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pane-head h1 {
  margin: 6px 0 0;
  font-size: 1.6rem;
}

.pane-copy,
.hint-list,
.field-label,
.status,
.message-body,
.empty-copy,
.conversation-user span,
.info-list article,
.card-headline span {
  color: var(--muted);
}

.pane-copy,
.empty-copy,
.hint-list,
.message-body {
  line-height: 1.6;
}

.teams-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.card-headline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.card-headline strong {
  font-size: 0.96rem;
}

.prompt-list {
  display: grid;
  gap: 8px;
}

.prompt-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  border-radius: 6px;
  padding: 0 12px;
  text-align: left;
  cursor: pointer;
}

.hint-list {
  margin: 0;
  padding-left: 18px;
}

.teams-main {
  min-width: 0;
  display: grid;
  grid-template-rows: 72px 1fr auto;
  background: #fff;
}

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

.conversation-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.conversation-user strong {
  display: block;
  font-size: 1rem;
}

.chat-badge,
.side-pill {
  min-height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.messages {
  min-height: 0;
  overflow-y: auto;
  padding: 24px 26px 16px;
  display: grid;
  gap: 14px;
  align-content: start;
  background:
    linear-gradient(180deg, rgba(245, 247, 252, 0.72), rgba(255, 255, 255, 0.96));
}

.message {
  max-width: min(760px, 88%);
  display: grid;
  gap: 6px;
}

.message.user {
  justify-self: end;
}

.message.bot {
  justify-self: start;
}

.meta-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.message-tag {
  color: var(--ink);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.86rem;
}

.message-meta {
  font-size: 0.76rem;
  letter-spacing: 0;
  text-transform: none;
}

.message-body {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  white-space: pre-wrap;
}

.message.user .message-body {
  background: #e8ecfd;
  border-color: #cdd6ff;
}

.empty-state {
  padding: 18px;
  border: 1px dashed #cdd4e5;
  background: #f8f9fc;
  border-radius: 10px;
}

.empty-state strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

.empty-prompts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.composer {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.composer-surface {
  border: 1px solid #cfd5e6;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(31, 36, 48, 0.05);
}

.composer textarea {
  width: 100%;
  min-height: 92px;
  border: 0;
  padding: 14px 16px 8px;
  resize: vertical;
  outline: none;
  color: var(--ink);
}

.composer-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 0 12px 12px;
}

.composer-hints {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
}

.status {
  color: var(--ink);
}

.composer button,
.actions button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.actions button.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.field-label {
  display: block;
  margin-top: 12px;
  font-size: 0.88rem;
}

input,
textarea {
  font: inherit;
}

input {
  width: 100%;
  margin-top: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #cfd5e6;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
textarea:focus {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.info-list {
  display: grid;
  gap: 10px;
}

.info-list article {
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.info-list article strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 0.95rem;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #edf0f8;
  color: #2d3351;
}

@media (max-width: 1280px) {
  .teams-workspace {
    grid-template-columns: 68px 260px minmax(0, 1fr);
  }

  .teams-rightpane {
    display: none;
  }
}

@media (max-width: 980px) {
  .teams-topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar-center {
    display: none;
  }

  .teams-workspace {
    grid-template-columns: 60px 1fr;
  }

  .teams-leftpane {
    display: none;
  }
}

@media (max-width: 760px) {
  .login-frame {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .login-aside {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .teams-shell {
    grid-template-rows: auto 1fr;
  }

  .teams-topbar {
    min-height: 48px;
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

  .topbar-right {
    display: none;
  }

  .teams-workspace {
    grid-template-columns: 1fr;
  }

  .teams-rail {
    display: none;
  }

  .conversation-head,
  .messages,
  .composer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .message {
    max-width: 100%;
  }

  .composer-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .composer button {
    width: 100%;
  }
}
