:root {
  --bg: #ffffff;
  --bg-subtle: #f6f7f9;
  --border: #e2e6ec;
  --text: #1a1d21;
  --text-muted: #5c6570;
  --accent: #2563eb;
  --nav-width: 280px;
  --nav-collapsed: 48px;
  --agent-width: 600px;
  --topbar-height: 52px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
}

.platform-topbar {
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  background: var(--bg);
}

.platform-topbar .brand {
  font-weight: 600;
  font-size: 1rem;
}

.platform-topbar .context {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.platform-body {
  display: flex;
  height: calc(100vh - var(--topbar-height));
}

.platform-nav {
  width: var(--nav-width);
  border-right: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 0.75rem 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.platform-nav.collapsed {
  width: var(--nav-collapsed);
}

.platform-nav a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}

.platform-nav a:hover,
.platform-nav a.active {
  background: var(--bg);
  color: var(--accent);
}

.platform-agent {
  width: var(--agent-width);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: var(--bg);
}

.platform-agent-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 600;
}

.platform-agent-transcript {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.platform-agent-input {
  border-top: 1px solid var(--border);
  padding: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.platform-agent-input textarea {
  flex: 1;
  min-height: 2.5rem;
  max-height: 8rem;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
  font: inherit;
}

.platform-agent-input button {
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.platform-agent-transcript .msg {
  margin-bottom: 0.75rem;
}

.platform-agent-transcript .who {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.platform-agent-transcript .bubble {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  white-space: pre-wrap;
}

.platform-agent-transcript .msg.user .bubble {
  background: #eef4ff;
}

.platform-canvas {
  flex: 1;
  overflow: auto;
  padding: 1.5rem;
  position: relative;
}

.platform-canvas--operator {
  background-color: #ffffff;
  background-image: var(--canvas-brand-url);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: min(72%, 560px);
}

.platform-canvas--operator > * {
  position: relative;
  z-index: 1;
  max-width: 42rem;
}

.platform-canvas h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.auth-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0c0c0e;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.55) 50%,
    rgba(0, 0, 0, 0.65) 100%
  );
  z-index: 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  padding: 2rem 2rem 1.75rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.auth-logo {
  display: block;
  max-width: 160px;
  max-height: 48px;
  width: auto;
  height: auto;
  margin: 0 auto 1.25rem;
  object-fit: contain;
}

.auth-banner {
  display: block;
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto 1.25rem;
}

.auth-card h1 {
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 1.25rem;
  text-align: center;
  color: var(--text-muted);
}

.auth-card input {
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.auth-card button {
  width: 100%;
  padding: 0.6rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}

.auth-card .message {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  text-align: center;
  color: var(--text-muted);
}

