:root {
  --bg: #ffffff;
  --fg: #1a1a2e;
  --muted: #5b5b6b;
  --border: #e2e2ea;
  --accent: #2d6cdf;
  --card: #f7f8fb;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
  font-size: 14px;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.panel-header h1 { font-size: 15px; margin: 0; }
.panel-header .logo {
  display: block;
  height: 22px;
  width: auto;
  max-width: 170px; /* the panel can be narrow; never crowd out the context badge */
  flex: none;
}

/* Available to screen readers, removed from the visual layout. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.who {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 45%;
}

.badge {
  font-size: 11px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}

.search {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
}
/* Wrapper exists so the suggestion list can anchor to the input. */
.search-field {
  position: relative;
  flex: 1;
  min-width: 0;
}
/* Words still being spoken, not yet searched. */
.search input.live { color: var(--muted); font-style: italic; }
.search input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

/* Type-ahead dropdown */
.suggest {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(26, 26, 46, 0.12);
}
.suggest li {
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.35;
  color: var(--fg);
}
.suggest li strong {
  font-weight: 600;
  color: var(--accent);
}
.suggest li:hover,
.suggest li.active {
  background: var(--card);
}
.search button,
.actions button,
.authorize-btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}

/* Meeting scope control. Deliberately conspicuous while active — the panel must
   never be quietly receiving a call. Chat and speech are independent so a team
   can take chat commands without any speech leaving the meeting. */
.follow {
  margin: 0 14px 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.follow legend { font-size: 11px; color: var(--muted); padding: 0 4px; }
.follow label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 2px 0;
  cursor: pointer;
}
.follow code {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 3px;
}
.reply-opt { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 6px; }
.reply-opt:has(input:disabled) { opacity: 0.5; }

.listen {
  display: block;
  width: 100%;
  margin: 8px 0 0;
  padding: 7px 12px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.listen:disabled { opacity: 0.55; cursor: default; }

.follow-state { margin: 6px 0 0; font-size: 11px; color: var(--muted); }

/* Only while a stream is actually running. A red "Not following" reads as an
   error when it is in fact the safe, idle state. */
.follow.on { border-color: #c0392b; background: #fdecea; }
.follow.on .listen { border-color: #c0392b; background: #c0392b; }
.follow.on .follow-state { color: #a5281b; font-weight: 600; }

.results { padding: 0 14px 16px; }

/* Idle-state widgets: breaking news + most viewed */
.home-head {
  font-size: 11px;
  color: var(--muted);
  margin: 14px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.card.news { padding: 10px; }
.card.news.clickable { cursor: pointer; }
.card.news.clickable:hover { border-color: var(--accent); }
.news-title { margin: 0; font-weight: 600; font-size: 13px; line-height: 1.35; }
.card.news .snippet { margin: 4px 0 0; }

.card.source .kind { color: var(--accent); font-size: 11px; }

.empty {
  color: var(--muted);
  padding: 24px 4px;
  text-align: center;
}

.auto-label {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; }
.card h3 { margin: 0 0 6px; font-size: 13px; }
.answer-text { margin: 0 0 10px; line-height: 1.5; }
.score { font-size: 11px; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions button { background: #fff; color: var(--accent); }

.pending {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 2px;
}
/* AI answer + citation cards */
.ai-chip {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0b6b52;
  background: #ddf3ec;
  border-radius: 4px;
  padding: 2px 6px;
}
.quick-chip {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1d4ed8;
  background: #e5edff;
  border-radius: 4px;
  padding: 2px 6px;
}
.card.quick { border-color: #c7d7fe; }
.quick-title { margin: 6px 0 2px; font-weight: 600; font-size: 13px; }
.quick-body { font-size: 13px; line-height: 1.5; }
.quick-body h5 { margin: 8px 0 2px; font-size: 12px; color: #44546f; }
.quick-body p { margin: 0 0 6px; }
.card.source { padding: 10px; }
.source-head { display: flex; align-items: baseline; gap: 6px; }
.doc-ic { font-size: 12px; flex: none; }
.source-title { font-weight: 600; font-size: 13px; flex: 1; min-width: 0; }
.pill {
  flex: none;
  font-size: 10px;
  color: #0b6b52;
  background: #ddf3ec;
  border-radius: 999px;
  padding: 1px 7px;
}
.source-meta { margin: 3px 0 0 18px; font-size: 11px; color: var(--muted); }
.source-path {
  margin: 2px 0 0 18px;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-meta .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.cites { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0 18px; }
.cite {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px 2px 3px;
  font-size: 11px;
  color: var(--fg);
  cursor: pointer;
}
.cite:hover { border-color: var(--accent); }
.cite-n {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  min-width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
}
.related-head { font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.snippet { margin: 4px 0 0; color: var(--muted); }

.link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  text-align: left;
}

.skeleton {
  height: 56px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---- Article design (ported from the KMS-in-Jira panel) ---- */
:root {
  --subtle: #6b778c;
  --link: #0c66e4;
  --text: #172b4d;
  --hover: #f4f5f7;
}

.article-view { padding: 12px 14px; }
.detail { padding: 0 2px; }
.back {
  background: none; border: none; color: var(--link); cursor: pointer;
  padding: 0; font-size: 13px; margin-bottom: 8px;
}
.back:hover { text-decoration: underline; }
.detail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.detail-title { font-size: 16px; font-weight: 600; margin: 0; color: var(--text); }
.detail-id { color: var(--subtle); font-size: 11px; white-space: nowrap; }
.muted { color: var(--subtle); line-height: 1.5; padding: 8px 0; }

/* Tabs */
.tabs { margin-top: 14px; }
.tab-title { font-size: 13px; color: #44546f; margin: 0 0 4px; }
.tablist { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.tabbtn {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 8px 10px; font: inherit; font-size: 13px; color: var(--subtle);
  cursor: pointer; white-space: nowrap;
}
.tabbtn:hover { color: var(--text); }
.tabbtn.active { color: var(--link); border-bottom-color: var(--link); font-weight: 600; }

/* Article body */
.article-body { padding: 4px 6px 12px; line-height: 1.55; word-break: break-word; overflow-wrap: anywhere; }
.article-body img { max-width: 100%; height: auto; }
.article-body p { margin: 0 0 8px; }
.article-body h1, .article-body h2, .article-body h3, .article-body h4 { font-size: 14px; font-weight: 700; margin: 16px 0 4px; }
.article-body .fieldLabel, .article-body .item-view-field-label { font-weight: 600; color: #44546f; margin: 8px 0 1px; }
.article-body ul, .article-body ol { margin: 4px 0 8px; padding-left: 20px; }
.article-body li { margin: 2px 0; }
.article-body .item-view-element-caption { display: block; font-weight: 700; font-size: 13px; color: var(--text); margin: 0 0 6px; }
.article-body .item-view-element-row { border-left: 3px solid #dfe1e6; padding: 2px 0 2px 12px; margin: 14px 0; }
.article-body .item-view-element-row:first-child { margin-top: 4px; }

/* Tables */
.article-body .container-type-table { overflow-x: auto; margin: 8px 0; }
.article-body table { border-collapse: collapse; width: 100%; font-size: 13px; }
.article-body th, .article-body td { border: 1px solid #dfe1e6; padding: 8px 10px; text-align: left; vertical-align: top; word-break: break-word; }
.article-body th { background: #f7f8f9; font-weight: 600; color: #44546f; white-space: nowrap; }
.article-body td img { max-width: 140px; height: auto; }
.article-body th[data-col-id="0"], .article-body td[data-col-id="0"] { display: none; }
.article-body select.filter-field { margin: 4px 0 12px; padding: 7px 10px; border: 1px solid #8590a2; border-radius: 4px; font: inherit; background: #fff; max-width: 100%; }

/* FAQ cards */
.faq-list { display: flex; flex-direction: column; gap: 12px; margin: 8px 0; }
.faq-card-a { border: 1px solid #dfe1e6; border-radius: 8px; padding: 14px 16px; }
.faq-qrow, .faq-arow { display: flex; gap: 10px; align-items: flex-start; }
.faq-arow { margin-top: 12px; padding-top: 12px; border-top: 1px solid #f1f2f4; }
.faq-badge { flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.faq-badge.q { background: #0c66e4; color: #fff; }
.faq-badge.a { background: #e9f2ff; color: #0c66e4; }
.faq-qt { font-weight: 600; line-height: 1.4; }
.faq-at { color: var(--text); line-height: 1.6; }

/* Collapsible sections */
.kms-expand-ctrl { margin: 4px 0 8px; }
.kms-expand-all { background: none; border: 1px solid #dfe1e6; border-radius: 4px; padding: 4px 10px; font: inherit; font-size: 12px; color: #44546f; cursor: pointer; }
.kms-expand-all:hover { border-color: #0c66e4; color: #0c66e4; }
.kms-section-header { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.kms-section-header:hover { color: #0c66e4; }
.kms-chevron { flex: none; align-self: stretch; display: inline-flex; align-items: center; justify-content: center; width: 18px; min-height: 1.4em; font-size: 17px; line-height: 1; color: #44546f; transition: transform .12s ease; transform-origin: center; }
.kms-section-header:hover .kms-chevron { color: #0c66e4; }
.kms-chevron.open { transform: rotate(90deg); }

/* Linked-item rows */
.kms-linked-row { cursor: pointer; }
.kms-linked-row:hover > td, .kms-linked-row:hover { background: #f7f8f9; }

/* Linked-scenario "guide" opener */
.kms-open-scenario {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  margin: 8px 0; padding: 9px 14px;
  border: 1px solid #dfe1e6; border-radius: 6px; background: #f7f8f9;
  color: var(--link); font-weight: 600;
}
.kms-open-scenario:hover { background: #e9f2ff; border-color: var(--link); }
.kms-open-scenario:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.kms-open-scenario-ic { font-size: 11px; }

/* Scenario player */
.scenario-img { max-width: 100%; height: auto; border-radius: 6px; margin: 0 0 10px; }
.article-body .scenario-step-img { display: block; max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; }
.scenario-question { font-weight: 600; font-size: 15px; margin: 14px 0 10px; color: var(--text); }
.scenario-step-heading { font-weight: 600; margin: 0 0 4px; }
.scenario-end { margin: 12px 0; }
.decisions { display: flex; flex-direction: column; gap: 8px; }
.decision {
  text-align: left; background: #f7f8f9; border: 1px solid #dfe1e6; border-radius: 6px;
  padding: 10px 12px; font: inherit; cursor: pointer; color: var(--text);
}
.decision:hover { background: #e9f2ff; border-color: var(--link); }
.scenario-nav { display: flex; gap: 16px; margin-top: 16px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Broken-image placeholder */
.img-placeholder {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border: 1px dashed #c1c7d0; border-radius: 4px;
  color: var(--subtle); font-size: 12px; background: #f7f8f9;
}

/* Glossary terms */
.glossary-term { position: relative; border-bottom: 1px dashed #0c66e4; color: #0c66e4; cursor: help; outline: none; }
.glossary-tooltip { position: absolute; left: 0; bottom: 125%; z-index: 30; width: max-content; max-width: 260px; background: #172b4d; color: #fff; font-size: 12px; font-weight: 400; line-height: 1.45; padding: 8px 10px; border-radius: 6px; box-shadow: 0 4px 12px rgba(9,30,66,.25); opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.glossary-tooltip-title { display: block; font-weight: 700; margin-bottom: 2px; }
.glossary-term:hover .glossary-tooltip, .glossary-term:focus-within .glossary-tooltip { opacity: 1; }

/* Settings link for Zoom account owners and admins. Sits after the identity
   chip; when the chip is hidden it takes over the right-hand margin itself. */
.settings-link {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.who[hidden] + .settings-link { margin-left: auto; }
.settings-link:hover { color: var(--text, inherit); text-decoration: underline; }

/* Re-authorization prompt (Zoom's requirement for a user who removed the app
   and came back): the message, the button that reruns in-client OAuth, and a
   line for when it does not complete. */
.authorize p { margin: 0 0 12px; }
.authorize .authorize-btn:disabled { opacity: .6; cursor: default; }
.authorize .authorize-msg { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
