/* chatJPt theme — palette derived from jpaul.me (daily3 theme):
   primary blue #326693, accent green #a3bb43, slate text #313131. */
:root {
  --jp-primary: #326693;
  --jp-primary-dark: #284f73;
  --jp-accent: #a3bb43;
  --jp-bg: #f3f4f5;
  --jp-surface: #ffffff;
  --jp-text: #313131;
  --jp-muted: #6b7280;
  --jp-border: #dcdcde;
  --jp-danger: #dd3737;
  --jp-radius: 12px;
  --jp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
/* the hidden attribute must win over display:flex etc. (same specificity) — keeps
   the sidebar + chat composer fully hidden until the user signs in. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--jp-font);
  color: var(--jp-text);
  background: var(--jp-bg);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: var(--jp-primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.brand { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.brand-jp { color: #cfe0ee; }
.brand-t { color: var(--jp-accent); }
.tagline { font-size: 13px; opacity: 0.85; }
.logout {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
}
.logout:hover { background: rgba(255, 255, 255, 0.12); }

/* Fill the screen — full width with responsive side padding (was a narrow centered column). */
.wrap { flex: 1; width: 100%; max-width: none; margin: 0; padding: 18px clamp(16px, 3vw, 44px); display: flex; }

/* Email gate */
.gate { margin: auto; background: var(--jp-surface); border: 1px solid var(--jp-border); border-radius: var(--jp-radius); padding: 32px; max-width: 460px; }
.gate h1 { margin: 0 0 8px; font-size: 22px; color: var(--jp-primary-dark); }
.muted { color: var(--jp-muted); font-size: 14px; line-height: 1.5; }
#gate-form { display: flex; gap: 8px; margin-top: 18px; }
#gate-form input { flex: 1; padding: 11px 12px; border: 1px solid var(--jp-border); border-radius: 8px; font-size: 15px; }
#gate-form input:focus { outline: 2px solid var(--jp-primary); border-color: var(--jp-primary); }
.gate-msg { margin-top: 12px; font-size: 14px; min-height: 1.2em; }
.gate-msg.ok { color: var(--jp-primary-dark); }
.gate-msg.err { color: var(--jp-danger); }

/* Chat */
.chat { flex: 1; display: flex; flex-direction: column; width: 100%; }
.transcript { flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 14px; padding-bottom: 12px; }
.msg { display: flex; min-width: 0; }
.msg.user { justify-content: flex-end; }
/* assistant column capped at a readable measure while the app fills the screen */
.msg.assistant { flex-direction: column; align-items: flex-start; gap: 6px; max-width: 1000px; }
.bubble {
  max-width: 100%;
  padding: 11px 14px;
  border-radius: var(--jp-radius);
  line-height: 1.55;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.msg.user .bubble { max-width: 70%; background: var(--jp-primary); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.assistant .bubble { background: var(--jp-surface); border: 1px solid var(--jp-border); border-bottom-left-radius: 4px; }
.bubble a { color: var(--jp-primary); word-break: break-word; }
.bubble pre { background: #1f2733; color: #e6edf3; padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 13px; }
/* code block with a copy button in the corner */
.code-wrap { position: relative; }
.copy-btn { position: absolute; top: 6px; right: 6px; z-index: 1; font-size: 11px; font-family: inherit; color: #cbd5e1; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 6px; padding: 2px 9px; cursor: pointer; opacity: 0.7; transition: opacity 0.15s, color 0.15s; }
.code-wrap:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.copy-btn.copied { color: var(--jp-accent); border-color: var(--jp-accent); }
.bubble code { background: rgba(50, 102, 147, 0.1); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.bubble pre code { background: none; padding: 0; }
/* rendered markdown inside an assistant bubble */
.bubble > :first-child { margin-top: 0; }
.bubble > :last-child { margin-bottom: 0; }
.bubble p { margin: 6px 0; }
.bubble blockquote { margin: 10px 0; padding: 6px 14px; border-left: 4px solid var(--jp-accent); background: rgba(163, 187, 67, 0.1); border-radius: 0 8px 8px 0; }
.bubble blockquote p { margin: 4px 0; }
.bubble h3, .bubble h4, .bubble h5 { margin: 12px 0 4px; line-height: 1.3; color: var(--jp-primary-dark); }
.bubble h3 { font-size: 17px; }
.bubble h4 { font-size: 15px; }
.bubble h5 { font-size: 14px; }
.bubble ul, .bubble ol { margin: 6px 0; padding-left: 22px; }
.bubble li { margin: 2px 0; }
.bubble hr { border: 0; border-top: 1px solid var(--jp-border); margin: 12px 0; }
.bubble table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 14px; display: block; overflow-x: auto; }
.bubble th, .bubble td { border: 1px solid var(--jp-border); padding: 6px 10px; text-align: left; vertical-align: top; }
.bubble thead th { background: #eef1f4; color: var(--jp-primary-dark); }
.bubble tbody tr:nth-child(even) { background: #fafbfc; }
/* tool pills: a wrap row ABOVE the bubble (not flex siblings of it) */
.tools { display: flex; flex-wrap: wrap; gap: 6px; max-width: 80%; }
.tool-chip { font-size: 12px; color: var(--jp-muted); background: #eef1f4; border: 1px solid var(--jp-border); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.cursor::after { content: "▍"; color: var(--jp-accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.composer { display: flex; gap: 8px; margin-top: 10px; }
.composer textarea { flex: 1; resize: none; padding: 11px 12px; border: 1px solid var(--jp-border); border-radius: 10px; font-family: inherit; font-size: 15px; max-height: 160px; }
.composer textarea:focus { outline: 2px solid var(--jp-primary); border-color: var(--jp-primary); }
.composer button, #gate-form button {
  background: var(--jp-primary); color: #fff; border: 0; border-radius: 10px;
  padding: 0 18px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.composer button:hover, #gate-form button:hover { background: var(--jp-primary-dark); }
.composer button:disabled { background: var(--jp-muted); cursor: default; }
/* Connect a ZVM (beta): composer button and the "connected" chip */
.composer .attach-btn { background: var(--jp-surface); color: var(--jp-text); border: 1px solid var(--jp-border); padding: 0 12px; font-size: 17px; }
.composer .attach-btn:hover { background: var(--jp-surface); border-color: var(--jp-primary); }
.composer .attach-btn.on { background: #e3f6ef; border-color: var(--jp-primary); }
.composer .attach-btn { position: relative; }
.attach-btn .count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; border-radius: 999px; background: var(--jp-primary); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.zvm-steps { padding-left: 20px; margin: 8px 0; }
.cz-head { margin: 14px 0 0; font-size: 16px; }
.zvm-steps li { margin: 8px 0; }
.bm-link { display: inline-block; margin-top: 6px; padding: 6px 12px; border-radius: 8px; background: var(--jp-primary); color: #fff !important; text-decoration: none; font-weight: 600; cursor: grab; }
.zvm-more { margin: 4px 0 8px; font-size: 14px; }
.zvm-more summary { cursor: pointer; color: var(--jp-primary-dark); }
.zvm-open { display: flex; gap: 8px; margin: 6px 0 2px; }
.zvm-open input { margin-top: 0 !important; }
/* Quota bar above the composer: amber when close, red when over */
.quota-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; padding: 8px 12px; border-radius: 10px; font-size: 14px; background: #fff4d6; border: 1px solid #f0d58a; color: #5c4400; }
.quota-bar.over { background: #fde8e8; border-color: #f2b8b8; color: #7a1d1d; }
.qb-text { flex: 1 1 240px; min-width: 0; }
.qb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.qb-close { background: transparent; border: 0; font-size: 18px; line-height: 1; color: inherit; cursor: pointer; padding: 2px 6px; opacity: .7; }
.qb-close:hover { opacity: 1; }
.qd-section { border-top: 1px solid var(--jp-border); padding-top: 10px; margin-top: 12px; }
.qd-section h3 { margin: 0 0 4px; font-size: 15px; }
.qd-section label { display: block; margin-top: 8px; }
.disclaimer { color: var(--jp-muted); font-size: 12px; text-align: center; margin: 8px 0 0; }

/* ---------- layout + history sidebar ---------- */
.layout { flex: 1; display: flex; min-height: 0; }
.wrap, .chat { min-height: 0; }
.icon-btn { background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 4px 6px; border-radius: 6px; opacity: 0.7; }
.icon-btn:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }
.topbar .icon-btn { color: #fff; }

.sidebar { width: 270px; flex-shrink: 0; background: var(--jp-surface); border-right: 1px solid var(--jp-border); display: flex; flex-direction: column; overflow: hidden; }
.new-chat { margin: 12px; padding: 10px 12px; border: 1px solid var(--jp-border); background: #fff; color: var(--jp-primary-dark); border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; }
.new-chat:hover { border-color: var(--jp-primary); background: #f7fafd; }
.convo-list { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.gate-privacy a { color: var(--jp-primary); }
/* ZVM connection manager: between the chat list and the user menu */
.conns { border-top: 1px solid var(--jp-border); padding: 8px 8px 6px; max-height: 40%; overflow-y: auto; flex-shrink: 0; }
.conns-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 4px; font-size: 12px; font-weight: 700; color: var(--jp-muted); }
.conns-head .icon-btn { font-size: 16px; opacity: 1; color: var(--jp-primary); }
.conns-list { list-style: none; margin: 0; padding: 0; }
.conns-list li { display: flex; align-items: flex-start; gap: 8px; padding: 6px; border-radius: 8px; }
.conns-list li:hover { background: #eef1f4; }
.conns-list .dot { width: 8px; height: 8px; margin-top: 6px; flex: none; border-radius: 50%; background: #2e9e6a; }
.conns-list .dot.reconnecting { background: #e0a100; }
.conns-list .site { flex: 1; min-width: 0; font-size: 14px; }
.conns-list .site b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conns-list .site span { display: block; font-size: 12px; color: var(--jp-muted); }
.conns-list .site b .kind { display: inline-block; margin-right: 6px; padding: 0 5px; border: 1px solid var(--jp-border); border-radius: 4px; font-size: 10px; font-weight: 700; line-height: 16px; vertical-align: 1px; color: var(--jp-muted); }
.conns-list .icon-btn { font-size: 13px; }
.conns-empty { width: 100%; text-align: left; padding: 6px; border: 1px dashed var(--jp-border); border-radius: 8px; background: transparent; color: var(--jp-primary-dark); font: inherit; font-size: 13px; cursor: pointer; }
.conns-empty:hover { border-color: var(--jp-primary); }
.um-note { color: var(--jp-muted); font-size: 12px; }
.gate-privacy { font-size: 13px; color: var(--jp-muted); margin-top: 14px; }
.convo { display: flex; align-items: center; border-radius: 8px; }
.convo:hover { background: #eef1f4; }
.convo.active { background: #e3edf5; }
.convo-title { flex: 1; min-width: 0; background: transparent; border: 0; cursor: pointer; text-align: left; padding: 9px 10px; font-size: 14px; color: var(--jp-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-actions { display: none; padding-right: 4px; }
.convo:hover .convo-actions, .convo.active .convo-actions { display: flex; }

/* ---------- export buttons under an answer ---------- */
.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.act { font-size: 12px; color: var(--jp-primary-dark); background: #eef1f4; border: 1px solid var(--jp-border); border-radius: 8px; padding: 3px 10px; cursor: pointer; }
.act:hover { background: #e3edf5; border-color: var(--jp-primary); }
.fb { display: inline-flex; gap: 6px; align-items: center; margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--jp-border); }
.fb-btn.on { background: #e3edf5; border-color: var(--jp-primary); }
.fb-status { font-size: 12px; color: var(--jp-muted); }
.fb-comment { margin-top: 8px; width: 100%; max-width: 640px; align-self: stretch; box-sizing: border-box; }
.fb-comment textarea { width: 100%; box-sizing: border-box; min-height: 96px; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--jp-border); border-radius: 8px; resize: vertical; }
.fb-comment-row { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.fb-err { font-size: 12px; color: var(--jp-danger); }

/* ---------- responsive: sidebar becomes a drawer ---------- */
@media (min-width: 860px) { #sidebar-toggle { display: none; } }
@media (max-width: 859px) {
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 30; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15); }
  .sidebar.open { transform: translateX(0); }
}

/* ---------- user menu (bottom-left of the chat sidebar) ---------- */
.user-area { position: relative; border-top: 1px solid var(--jp-border); padding: 8px; }
.user-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: var(--jp-text); font: inherit; text-align: left; }
.user-btn:hover, .user-btn[aria-expanded="true"] { background: #eef1f4; }
.user-btn .avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--jp-primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.user-label { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-btn .caret { color: var(--jp-muted); font-size: 12px; }
.user-menu { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 4px); z-index: 40; background: var(--jp-surface); border: 1px solid var(--jp-border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16); padding: 6px; max-height: 75vh; overflow-y: auto; }
.user-menu [role="menuitem"] { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 14px; color: var(--jp-text); text-decoration: none; cursor: pointer; }
.user-menu [role="menuitem"]:hover, .user-menu [role="menuitem"]:focus-visible { background: #eef1f4; outline: none; }
.user-menu [role="menuitem"].danger { color: var(--jp-danger); }
.um-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--jp-border); margin-bottom: 4px; }
.um-email { font-weight: 600; font-size: 14px; word-break: break-all; }
.um-quota { margin-top: 8px; }
.um-quota-label { font-size: 12px; color: var(--jp-muted); }
.um-bar { margin-top: 5px; height: 6px; border-radius: 3px; background: #e6e9ed; overflow: hidden; }
.um-bar span { display: block; height: 100%; background: var(--jp-accent); transition: width .3s; }
.um-bar span.hot { background: var(--jp-danger); }
.um-sep { height: 1px; background: var(--jp-border); margin: 4px 6px; }

/* ---------- passkey sign-in on the gate ---------- */
.passkey-signin { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.passkey-signin .or { color: var(--jp-muted); font-size: 13px; }
button.secondary { background: var(--jp-surface); color: var(--jp-primary-dark); border: 1px solid var(--jp-border); border-radius: 10px; padding: 9px 14px; font: inherit; font-size: 14px; cursor: pointer; }
button.secondary:hover { border-color: var(--jp-primary); }
button.secondary:disabled { opacity: .5; cursor: default; }
button.small { padding: 4px 10px; font-size: 13px; }

/* ---------- profile dialogs ---------- */
.dlg { width: min(520px, calc(100vw - 32px)); border: 1px solid var(--jp-border); border-radius: 14px; padding: 0; color: var(--jp-text); }
.dlg::backdrop { background: rgba(0, 0, 0, 0.35); }
.dlg-body { padding: 20px 22px; }
.dlg h2 { margin: 0 0 6px; font-size: 18px; }
.dlg p { margin: 6px 0 12px; }
.dlg textarea, .dlg input { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 9px 11px; border: 1px solid var(--jp-border); border-radius: 8px; margin-top: 4px; }
.dlg-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dlg-actions button:not(.secondary) { background: var(--jp-primary); color: #fff; border: 0; border-radius: 10px; padding: 9px 16px; font: inherit; font-size: 14px; cursor: pointer; }
.dlg-actions .danger-btn { background: var(--jp-danger) !important; }
.chat-opts { position: relative; display: flex; }
.opts-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #d97706; }
.opts-menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 20; width: min(320px, calc(100vw - 32px)); background: var(--jp-surface, #fff); border: 1px solid var(--jp-border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); padding: 6px; }
.opts-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.opts-item:hover { background: rgba(50, 102, 147, 0.08); }
.opts-item input { margin-top: 3px; }
.opts-item small { display: block; color: var(--jp-muted); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.opts-head { padding: 10px 10px 2px; font-size: 13px; font-weight: 600; border-top: 1px solid var(--jp-border); margin-top: 4px; }
.opts-head small { display: block; color: var(--jp-muted); font-size: 12px; font-weight: 400; line-height: 1.4; margin-top: 2px; }
.opts-item.product { padding: 5px 10px; }
.opts-item.product small { margin-top: 0; }
.prod-list { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 4px; }
.prod-list label { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; }
.prod-list input { width: auto; margin: 3px 0 0; }
.prod-list small { display: block; color: var(--jp-muted); font-size: 13px; }
.dlg .dlg-check { display: flex; gap: 8px; align-items: center; font-size: 15px; margin: 10px 0 4px; }
.dlg .dlg-check input { width: auto; margin: 0; }
.dlg-wide { width: min(680px, calc(100vw - 32px)); }
.news-list { max-height: min(60vh, 560px); overflow-y: auto; margin: 4px -4px 0; padding: 0 4px; }
.news-post { padding: 12px 0; border-bottom: 1px solid var(--jp-border); }
.news-post:last-child { border-bottom: 0; }
.news-post h3 { margin: 0 0 2px; font-size: 16px; }
.news-date { font-size: 12px; color: var(--jp-muted, #6b7280); }
.news-post .bubble { padding: 6px 0 0; }
.dlg-msg { font-size: 13px; color: var(--jp-primary-dark); min-height: 1em; }
.dlg-list { list-style: none; padding: 0; margin: 8px 0; }
.dlg-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--jp-border); }
.small { font-size: 12px; }
.tag { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #e3edf5; color: var(--jp-primary-dark); }

/* Playbooks (#77): cards on the new-chat screen, the pill and sidebar badge of a playbook chat. */
.pb-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.pb-cards-head { width: 100%; font-size: 13px; font-weight: 600; color: var(--jp-muted); }
.pb-card { flex: 1 1 240px; max-width: 360px; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 14px; background: var(--jp-surface); border: 1px solid var(--jp-border); border-radius: var(--jp-radius); font: inherit; color: var(--jp-text); cursor: pointer; }
.pb-card:hover { border-color: var(--jp-primary); background: #f7fafc; }
.pb-card:disabled { opacity: 0.6; cursor: progress; }
.pb-card b { color: var(--jp-primary-dark); font-size: 15px; }
.pb-card span { font-size: 13.5px; line-height: 1.4; }
.pb-card small { font-size: 12px; color: var(--jp-muted); }
.pb-pill { align-self: flex-start; margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--jp-primary-dark); background: #e3edf5; border: 1px solid #c9d9e8; border-radius: 999px; padding: 3px 12px; }
.pb-row { display: flex; gap: 6px; align-self: flex-start; }
.pb-files { cursor: pointer; font-family: inherit; }
.files-view { max-height: 50vh; overflow: auto; border: 1px solid var(--jp-border); border-radius: 8px; padding: 8px 12px; margin-top: 8px; }
.btn-link { display: inline-block; text-decoration: none; background: var(--jp-surface); color: var(--jp-primary-dark); border: 1px solid var(--jp-border); border-radius: 10px; padding: 9px 14px; font-size: 14px; }
.btn-link[hidden] { display: none; }
.dlg-list li.files-head { display: block; padding: 14px 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--jp-muted); }
.file-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.act.primary { background: var(--jp-primary); border-color: var(--jp-primary); color: #fff; font-weight: 600; }
.act.primary:hover { background: var(--jp-primary-dark); }
.act:disabled { opacity: .75; cursor: progress; }
.act.busy::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.file-err { color: var(--jp-danger); font-size: 12px; margin-top: 4px; }
.pb-pill.off { color: var(--jp-danger); background: #fdeeee; border-color: #f3c4c4; }
.pb-badge { margin-right: 6px; font-size: 12px; }
.opt-lock, .opts-item.product small.opt-lock { color: var(--jp-primary-dark); font-weight: 600; }
.opts-item input:disabled { cursor: not-allowed; }

/* vCenter VM selection (#93): the chip next to the playbook pill, the panel, the marker in the chat. */
.scope-chip { margin: 0 0 8px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--jp-primary-dark); background: #eef6e0; border: 1px solid #cfe0a8; border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.scope-chip::before { content: "▦ "; }
.scope-chip:hover { border-color: var(--jp-primary); }
.scope-chip.set { background: #e3edf5; border-color: #c9d9e8; }
.msg.selection { justify-content: center; }
.msg.selection span { font-size: 12px; color: var(--jp-muted); background: #eef1f4; border: 1px solid var(--jp-border); border-radius: 999px; padding: 2px 10px; }
.vm-panel { width: 380px; flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; background: var(--jp-surface); border-left: 1px solid var(--jp-border); }
.vmp-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; }
.vmp-title { flex: 1; min-width: 0; }
.vmp-title b { display: block; font-size: 15px; }
.vmp-title small { display: block; font-size: 12px; color: var(--jp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vmp-tools { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 8px; border-bottom: 1px solid var(--jp-border); }
.vmp-by { display: flex; }
.vmp-by button { flex: 1; font: inherit; font-size: 13px; padding: 5px 0; background: #fff; border: 1px solid var(--jp-border); cursor: pointer; color: var(--jp-text); }
.vmp-by button + button { border-left: 0; }
.vmp-by button:first-child { border-radius: 8px 0 0 8px; }
.vmp-by button:last-child { border-radius: 0 8px 8px 0; }
.vmp-by button[aria-pressed="true"] { background: #e3edf5; color: var(--jp-primary-dark); font-weight: 600; }
#vmp-search { font: inherit; font-size: 14px; padding: 6px 9px; border: 1px solid var(--jp-border); border-radius: 8px; }
.vmp-on { font-size: 13px; display: flex; gap: 6px; align-items: center; }
.vmp-body { flex: 1; overflow-y: auto; padding: 4px 6px; font-size: 13.5px; }
.vmp-body .muted { padding: 10px 6px; }
.vmp-msg { padding: 12px 8px; font-size: 14px; }
.vmp-msg.err { color: var(--jp-danger); }
.vmp-g { display: flex; align-items: center; gap: 6px; padding: 4px 4px; border-radius: 6px; }
.vmp-g:hover, .vmp-v:hover { background: #f3f6f9; }
.vmp-g .caret { width: 20px; border: 0; background: transparent; cursor: pointer; color: var(--jp-muted); font-size: 11px; padding: 0; }
.vmp-g .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vmp-g small, .vmp-v small { color: var(--jp-muted); font-size: 12px; white-space: nowrap; }
.vmp-v { display: flex; align-items: center; gap: 6px; padding: 3px 4px 3px 30px; border-radius: 6px; cursor: pointer; }
.vmp-v .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vmp-v .pdot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #b8c0ca; }
.vmp-v .pdot.on { background: #2e9e6a; }
.vmp-more { padding: 4px 30px; font-size: 12px; color: var(--jp-muted); }
.vmp-foot { border-top: 1px solid var(--jp-border); padding: 8px 12px 12px; }
.vmp-hint { margin: 0 0 6px; font-size: 12.5px; color: #7a5a00; background: #fff4d6; border: 1px solid #f0d58a; border-radius: 8px; padding: 5px 8px; }
.vmp-count { font-size: 13px; color: var(--jp-muted); margin-bottom: 8px; }
.vmp-actions { display: flex; gap: 6px; justify-content: flex-end; }
.vmp-apply { background: var(--jp-primary); color: #fff; border: 0; border-radius: 10px; padding: 4px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.vmp-apply:disabled { background: var(--jp-muted); cursor: default; }
@media (max-width: 859px) {
  .vm-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 35; width: min(420px, 100vw); box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15); }
}
#lg-form button { white-space: nowrap; }
#lg-list .lg-key { flex: 1; min-width: 0; }
.lg-get { border: 1px solid var(--jp-border); border-radius: var(--jp-radius); padding: 10px 14px; margin: 0 0 12px; }
.lg-get p { margin: 0 0 8px; }
.lg-get p:last-child { margin: 8px 0 0; }
.lg-dl { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-dl .btn-link { padding: 6px 12px; font-size: 13px; }
.lg-dl .btn-link.primary { background: var(--jp-primary); border-color: var(--jp-primary); color: #fff; font-weight: 600; }
.lg-light { width: 10px; height: 10px; flex: none; border-radius: 50%; }
.lg-light.on { background: #2e9e6a; box-shadow: 0 0 0 3px rgba(46, 158, 106, 0.18); }
.lg-light.off { background: #d64545; box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.18); }

/* Teams (#111): sidebar sections, the team pill, who asked, invite badges */
.convo-section { display: flex; align-items: center; gap: 2px; margin: 12px 2px 2px; }
.convo-section-name { flex: 1; min-width: 0; padding: 4px 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--jp-muted); background: transparent; border: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: inherit; }
button.convo-section-name { cursor: pointer; }
button.convo-section-name:hover { color: var(--jp-text); }
.convo-section .icon-btn { font-size: 14px; padding: 2px 6px; }
.convo-empty { padding: 4px 10px 8px; font-size: 13px; color: var(--jp-muted); }
.team-pill { background: #eaf6ee; border-color: #c4e3cf; color: #1d6b3a; }
.msg.with-author { flex-direction: column; align-items: flex-end; }
.msg .author { font-size: 12px; color: var(--jp-muted); margin: 0 4px 2px; }
.count-badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--jp-danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.tm-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.danger-text { color: var(--jp-danger); }
button.primary-sm { background: var(--jp-primary); color: #fff; border: 1px solid var(--jp-primary); border-radius: 10px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; }

/* A dropped answer stream while the page reconnects (#118). */
.reconnecting { margin: 4px 0 0 4px; font-size: 0.85em; color: var(--jp-muted); font-style: italic; }
