/* ─── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --bg: #f5f5f5;        /* page background */
  --surface: #ffffff;   /* card / elevated surface */
  --text: #111111;
  --accent: #6264a7;    /* Teams purple */
  --accent-hover: #4f50a0;
  --border: #e0e0e0;
  --hint: #666;         /* secondary / helper text */
}

/* ─── OS-level dark mode ─────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --surface: #2d2d2d;
    --text: #f0f0f0;
    --accent: #9ea5ff;
    --accent-hover: #b8bdff;
    --border: #444;
    --hint: #aaa;
  }
}

/* ─── Teams theme override ─────────────────────────────────────────────────
   Teams injects a data-theme attribute on <body> ("default", "dark",
   "contrast").  */
[data-theme='dark'],
[data-theme='contrast'] {
  --bg: #1a1a1a;
  --surface: #2d2d2d;
  --text: #f0f0f0;
  --accent: #9ea5ff;
  --accent-hover: #b8bdff;
  --border: #444;
  --hint: #aaa;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
}

/* ─── Base ─────────────────────────────────────────────────────────────────
   Segoe UI is the Teams typeface; the stack falls back gracefully on other
   platforms. */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ─── Page layout ──────────────────────────────────────────────────────────
   Constrain content width and centre it so the tab reads well on wide
   desktop clients. */
.app {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px;
}

h1 {
  font-size: 1.4rem;
  color: var(--accent);
  margin: 0 0 20px;
}

/* ─── Card ─────────────────────────────────────────────────────────────────
   Each functional section (post-to-chat, who-am-i, …) lives in a card so
   they're visually separated without hard dividers. */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 14px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Helper text ──────────────────────────────────────────────────────────
   Short description shown below a card heading. */
.hint {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--hint);
}

/* ─── JSON output ──────────────────────────────────────────────────────────
   Used inside .result cards to display raw server responses. */
pre {
  background: var(--bg);
  border-radius: 4px;
  padding: 10px;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

/* ─── Text input ───────────────────────────────────────────────────────────
   Full-width so it stays aligned with the button below it. */
input {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ─── Button ───────────────────────────────────────────────────────────────
   Teams-purple fill; transitions smoothly on hover. */
button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 18px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s;
}

button:hover {
  background: var(--accent-hover);
}

/* ─── Loading state ────────────────────────────────────────────────────────
   Shown while Teams SDK initialises (before app.initialize() resolves). */
.loading {
  padding: 60px;
  text-align: center;
  color: var(--hint);
}

/* ─── Result card ──────────────────────────────────────────────────────────
   Accent-coloured border makes the response stand out from regular cards. */
.result pre {
  border: 1px solid var(--accent);
}
