:root {
  --bg: #05070d;
  --bg-soft: #0b1220;
  --panel: #0c1526;
  --ink: #e8f2ff;
  --muted: #8ea6c4;
  --line: rgba(110, 168, 230, 0.22);
  --accent: #4aa3f0;
  --accent-deep: #1d4f8f;
  --accent-bright: #7ec8ff;
  --ok: #86efac;
  --warn: #fbbf24;
  --err: #fb7185;
  --idle: #93a4bd;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font-display: "Outfit", "IBM Plex Sans", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
[hidden] { display: none !important; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
}

.logo {
  display: block;
  width: min(100%, 280px);
  height: auto;
}

.logo-bar {
  width: 210px;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.login-view {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(320px, 480px) 1fr;
}

.login-panel {
  padding: 4rem 3rem;
  background:
    radial-gradient(circle at 0% 0%, rgba(74, 163, 240, 0.16), transparent 42%),
    linear-gradient(180deg, #0a1220 0%, #070b14 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  border-right: 1px solid var(--line);
}

.login-panel h1 {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.1;
}

.login-copy, .sidebar-copy, .owner-label {
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

#login-form {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
}

input {
  border: 1px solid var(--line);
  background: #08101c;
  color: var(--ink);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font: inherit;
}

input:focus {
  outline: 2px solid rgba(74, 163, 240, 0.45);
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  background: linear-gradient(90deg, #1d4f8f 0%, #3b82f6 55%, #7ec8ff 140%);
  color: #f4f9ff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--accent-bright);
  border: 1px solid rgba(126, 200, 255, 0.35);
}

.error { color: var(--err); margin: 0; }

.login-visual {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(59, 130, 246, 0.28), transparent 28%),
    radial-gradient(circle at 70% 70%, rgba(30, 64, 120, 0.45), transparent 40%),
    #000;
}

.login-visual img {
  width: min(72%, 640px);
  height: auto;
  filter: drop-shadow(0 0 28px rgba(74, 163, 240, 0.35));
}

.office-view {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1.25rem;
  background: rgba(5, 8, 16, 0.94);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.topbar-actions { display: flex; gap: 0.75rem; align-items: center; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(74, 163, 240, 0.1);
  color: #c5d8ee;
  font-size: 0.8rem;
}

.pill.ok { color: #bbf7d0; background: rgba(22, 101, 52, 0.35); }
.pill.bad { color: #fecdd3; background: rgba(159, 18, 57, 0.35); }

.workspace {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px);
  min-height: 0;
}

#office-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #f4efe6;
}

.office-stage {
  min-height: 0;
  overflow: auto;
  background: #140f0c;
  display: grid;
  align-items: center;
}

.office-frame {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.office-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  min-width: 92px;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.78);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.72rem;
  line-height: 1.15;
}

.hotspot strong { font-size: 0.75rem; }
.hotspot em {
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #bfdbfe;
  font-size: 0.65rem;
}

.hotspot.active {
  border-color: #7ec8ff;
  box-shadow: 0 0 0 2px rgba(74, 163, 240, 0.45);
}

.extra-bots {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
  display: flex;
  gap: 0.4rem;
}

.hotspot.chip {
  position: static;
  transform: none;
}

.sidebar {
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: 1.25rem;
  overflow: auto;
}

.sidebar h2, .bot-detail h3 {
  font-family: var(--font-display);
  margin: 0 0 0.35rem;
}

.bot-list {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 1.25rem;
}

.bot-card {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  background: #101b30;
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.bot-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74, 163, 240, 0.25);
}

.bot-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 0.3rem;
}

.bot-card strong { display: block; font-size: 0.95rem; }
.bot-card span { color: var(--muted); font-size: 0.8rem; }
.bot-card em {
  font-style: normal;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--idle);
}

.bot-detail {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.bot-detail dl {
  margin: 1rem 0;
  display: grid;
  gap: 0.75rem;
}

.bot-detail dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.bot-detail dd {
  margin: 0.15rem 0 0;
  font-weight: 500;
}

.chat-log {
  display: grid;
  gap: 0.45rem;
  max-height: 220px;
  overflow: auto;
  margin: 0.8rem 0 0.6rem;
}

.bubble {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.bubble.user {
  background: #16325c;
  justify-self: end;
}

.bubble.bot {
  background: #101b30;
  border: 1px solid var(--line);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  margin-top: 0;
}

.chat-form button {
  padding: 0.75rem 0.95rem;
}

.chat-hint {
  margin: 0.35rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

#rotate-key-out {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #05070d;
  color: #dbeafe;
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .login-view { grid-template-columns: 1fr; }
  .login-visual { min-height: 180px; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: 55vh auto; }
  .sidebar { border-left: 0; border-top: 1px solid var(--line); }
}
