/* ============================================================================
   BlackMind — premium chat UI for the Nexus LLM workspace.
   Theme-aware (all colors come from Nexus tokens in app.css), responsive down to
   phones, and motion respects prefers-reduced-motion. Three modes only:
   Flash / Pro / Gemini.
   ============================================================================ */

.bm-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  height: calc(100vh - 150px);
  height: calc(100dvh - 150px);
  min-height: 460px;
}
.bm-wrap.with-side { grid-template-columns: 264px 1fr; }

/* ---------------- sidebar ---------------- */
.bm-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.bm-newchat { width: 100%; justify-content: center; gap: 7px; }
.bm-side-lbl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); padding: 4px 6px 0; }
.bm-conv-list { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; min-height: 0; padding-right: 2px; }
.bm-conv {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent; color: var(--text-dim);
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.bm-conv:hover { background: var(--surface-2); color: var(--text); }
.bm-conv.active { background: var(--brand-glow); border-color: color-mix(in srgb, var(--brand) 35%, transparent); color: var(--text); }
.bm-conv-ic { flex: 0 0 auto; color: var(--text-faint); display: grid; place-items: center; }
.bm-conv.active .bm-conv-ic { color: var(--brand); }
.bm-conv-title { flex: 1; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-conv-del { opacity: 0; border: none; background: none; color: var(--text-faint); cursor: pointer; display: grid; place-items: center; padding: 2px; border-radius: 6px; transition: .12s; }
.bm-conv:hover .bm-conv-del { opacity: 1; }
.bm-conv-del:hover { color: var(--red); background: var(--red-soft); }
.bm-side-empty { color: var(--text-faint); font-size: 12.5px; padding: 10px 6px; line-height: 1.5; }

/* ---------------- main panel ---------------- */
.bm-main {
  position: relative;
  display: flex; flex-direction: column; min-height: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
  box-shadow: var(--shadow);
}
.bm-bar { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--border); background: var(--surface); }
.bm-icon-btn {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
  display: grid; place-items: center; cursor: pointer; transition: .12s;
}
.bm-icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.bm-bar-title { font-weight: 650; font-size: 13.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- thread ---------------- */
.bm-thread {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 24px 22px 12px;
  display: flex; flex-direction: column; gap: 20px;
  scroll-behavior: smooth;
}
.bm-row { display: flex; gap: 13px; width: 100%; max-width: 60rem; margin: 0 auto; animation: bm-rise .28s cubic-bezier(.2,.7,.3,1) both; }
.bm-row.user { justify-content: flex-end; }
.bm-row.assistant { justify-content: flex-start; }
@keyframes bm-rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.bm-ava {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px;
  background: linear-gradient(150deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 70%, transparent);
}
.bm-body { min-width: 0; max-width: 46rem; padding-top: 3px; }

/* user bubble */
.bm-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; max-width: 80%; }
.bubble { padding: 11px 15px; border-radius: 16px; font-size: 14px; line-height: 1.6; }
.bubble.user {
  background: linear-gradient(155deg, var(--brand), var(--brand-ink));
  color: #fff; border-bottom-right-radius: 5px;
  white-space: pre-wrap; word-break: break-word;
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--brand) 65%, transparent);
}

/* ---------------- markdown body ---------------- */
.bm-md { font-size: 14.5px; line-height: 1.68; color: var(--text); word-wrap: break-word; }
.bm-md > :first-child { margin-top: 0; }
.bm-md > :last-child { margin-bottom: 0; }
.bm-md p { margin: 0 0 11px; }
.bm-md .bm-h { margin: 18px 0 9px; font-weight: 720; line-height: 1.3; }
.bm-md h3.bm-h { font-size: 17px; }
.bm-md h4.bm-h { font-size: 15.5px; }
.bm-md h5.bm-h, .bm-md h6.bm-h { font-size: 14px; color: var(--text-dim); text-transform: none; }
.bm-md .bm-list { margin: 8px 0 12px; padding-left: 22px; }
.bm-md .bm-list .bm-list { margin: 4px 0 2px; }
.bm-md li { margin: 4px 0; }
.bm-md li::marker { color: var(--text-faint); }
.bm-md strong { font-weight: 700; color: var(--text); }
.bm-md em { font-style: italic; }
.bm-md del { opacity: .7; }
.bm-md a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.bm-md a:hover { color: var(--brand-2); }
.bm-md .bm-hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.bm-md .bm-ic {
  background: var(--surface-3); padding: 1.5px 6px; border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px;
  border: 1px solid var(--border-soft); word-break: break-word;
}
.bm-md .bm-quote {
  margin: 10px 0; padding: 4px 14px; color: var(--text-dim);
  border-left: 3px solid color-mix(in srgb, var(--brand) 55%, transparent);
  background: var(--brand-soft); border-radius: 0 8px 8px 0;
}

/* code blocks with a copy button */
.bm-md .bm-code { margin: 12px 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #0b1020; }
.bm-code-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px 6px 13px; background: #0d1426;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.bm-code-lang { font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: #8b95ad; }
.bm-code-copy {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04);
  color: #c7cede; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 8px; cursor: pointer; transition: .12s;
}
.bm-code-copy:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.bm-code-copy.done { color: var(--brand-2); border-color: color-mix(in srgb, var(--brand-2) 45%, transparent); }
.bm-md .bm-pre { margin: 0; padding: 13px 15px; overflow-x: auto; background: #0b1020; }
.bm-md .bm-pre code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.75px; line-height: 1.6; color: #e6eaf2; white-space: pre; }

/* tables */
.bm-md .bm-tablewrap { overflow-x: auto; margin: 12px 0; border: 1px solid var(--border); border-radius: 10px; }
.bm-md .bm-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.bm-md .bm-table th, .bm-md .bm-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.bm-md .bm-table th { background: var(--surface-2); font-weight: 700; color: var(--text); white-space: nowrap; }
.bm-md .bm-table tbody tr:last-child td { border-bottom: none; }
.bm-md .bm-table tbody tr:hover { background: var(--surface-2); }

/* web-grounded + stopped tags */
.bm-webtag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; color: var(--brand); background: var(--brand-glow); border-radius: 7px; padding: 3px 9px; margin-bottom: 9px; }
.bm-stopped { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; color: var(--text-faint); margin-bottom: 8px; }

/* thinking dots + streaming caret */
.bm-think { display: flex; align-items: center; gap: 6px; padding: 4px 0; min-height: 20px; }
.bm-think .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); animation: bm-pulse 1.2s infinite ease-in-out; }
.bm-think .dot:nth-child(2) { animation-delay: .18s; }
.bm-think .dot:nth-child(3) { animation-delay: .36s; }
@keyframes bm-pulse { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.bm-searching { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 13px; font-weight: 600; }
.bm-searching svg { color: var(--brand); animation: bm-spin 2.4s linear infinite; }
@keyframes bm-spin { to { transform: rotate(360deg); } }
.bm-cursor { display: inline-block; width: 8px; height: 16px; margin-left: 2px; vertical-align: text-bottom; background: var(--brand); border-radius: 2px; animation: bm-blink 1s steps(2, start) infinite; }
@keyframes bm-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* per-reply actions */
.bm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 12px; opacity: 0; transition: opacity .15s; }
.bm-actions-sp { flex: 1; }
.bm-row.assistant:hover .bm-actions, .bm-row.assistant:focus-within .bm-actions { opacity: 1; }
.bm-actions button {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
  font-size: 11.5px; font-weight: 600; padding: 5px 10px; border-radius: 8px; cursor: pointer; transition: .12s;
}
.bm-actions button:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.bm-actions button.done { color: var(--brand-2); border-color: color-mix(in srgb, var(--brand-2) 45%, transparent); }

/* attachments (user side) */
.bm-att-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.bm-att-img { max-width: 260px; max-height: 260px; border-radius: 12px; border: 1px solid var(--border); object-fit: cover; }
.bm-att { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); font-size: 12.5px; font-weight: 600; max-width: 260px; }
.bm-att svg { flex: 0 0 auto; color: var(--brand); }

/* jump-to-latest button */
.bm-jump {
  position: absolute; right: 20px; bottom: 148px; z-index: 4;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-md);
  transition: .14s; animation: bm-rise .2s ease both;
}
.bm-jump:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }

/* ---------------- composer dock ---------------- */
.bm-dock { border-top: 1px solid var(--border); background: var(--surface); padding: 12px 14px 8px; }
.bm-pending { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 9px; }
.bm-att.pend { background: var(--brand-glow); border-color: color-mix(in srgb, var(--brand) 40%, transparent); color: var(--text); }
.bm-att-x { border: none; background: none; color: var(--text-faint); cursor: pointer; display: grid; place-items: center; padding: 0; margin-left: 2px; }
.bm-att-x:hover { color: var(--red); }

.bm-composer { display: flex; flex-direction: column; gap: 10px; }
.bm-composer.drag { outline: 2px dashed var(--brand); outline-offset: 6px; border-radius: 14px; }

.bm-seg { display: inline-flex; align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.bm-seg button {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: none; background: none; color: var(--text-dim);
  font-size: 12.5px; font-weight: 650; padding: 6px 13px; border-radius: 8px; cursor: pointer; transition: .14s;
}
.bm-seg button svg { opacity: .85; }
.bm-seg button:hover { color: var(--text); }
.bm-seg button.active { background: var(--brand); color: #fff; box-shadow: 0 2px 8px -3px color-mix(in srgb, var(--brand) 70%, transparent); }
.bm-seg button.active svg { opacity: 1; }

.bm-inputwrap {
  display: flex; align-items: flex-end; gap: 8px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--bg);
  padding: 7px 7px 7px 9px; transition: border-color .14s, box-shadow .14s;
}
.bm-inputwrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.bm-clip { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; border: none; background: transparent; color: var(--text-faint); cursor: pointer; display: grid; place-items: center; transition: .12s; }
.bm-clip:hover { color: var(--brand); background: var(--brand-soft); }
#bm-input {
  flex: 1; resize: none; border: none; background: transparent; color: var(--text);
  font: inherit; font-size: 14.5px; line-height: 1.55; padding: 8px 2px; max-height: 200px; min-width: 0;
}
#bm-input:focus { outline: none; }
#bm-input::placeholder { color: var(--text-faint); }
.bm-send {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; border: none;
  background: var(--brand); color: #fff; cursor: pointer; display: grid; place-items: center; transition: .14s;
}
.bm-send:hover { background: var(--brand-2); transform: translateY(-1px); }
.bm-send.stop { background: var(--surface-3); color: var(--red); border: 1px solid var(--border); animation: bm-stoppulse 1.6s ease-in-out infinite; }
.bm-send.stop:hover { background: var(--red-soft); color: var(--red); transform: none; }
@keyframes bm-stoppulse { 0%, 100% { box-shadow: 0 0 0 0 var(--red-soft); } 50% { box-shadow: 0 0 0 5px transparent; } }
.bm-foot { padding: 8px 4px 2px; color: var(--text-faint); font-size: 11.5px; text-align: center; }

/* ---------------- empty / welcome ---------------- */
.bm-welcome { margin: auto; text-align: center; max-width: 600px; padding: 24px 20px; animation: bm-rise .4s ease both; }
.bm-orb {
  width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 20px;
  background: linear-gradient(150deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 18px 40px -14px color-mix(in srgb, var(--brand) 70%, transparent);
}
.bm-welcome h2 { font-size: 24px; margin: 0 0 8px; font-weight: 740; }
.bm-welcome p { color: var(--text-dim); font-size: 14px; line-height: 1.65; margin: 0 auto 22px; max-width: 500px; }
.bm-suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; text-align: left; }
.bm-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 13px;
  background: var(--surface-2); color: var(--text-dim); font-size: 13px; font-weight: 550;
  cursor: pointer; transition: .14s;
}
.bm-chip svg { flex: 0 0 auto; color: var(--text-faint); transition: .14s; }
.bm-chip:hover { border-color: var(--brand); color: var(--text); background: var(--brand-soft); transform: translateY(-1px); }
.bm-chip:hover svg { color: var(--brand); }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .bm-wrap, .bm-wrap.with-side { grid-template-columns: 1fr; height: auto; }
  .bm-side { max-height: none; }
  .bm-conv-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
  .bm-conv { flex: 0 0 auto; max-width: 220px; }
  .bm-side-lbl { display: none; }
  .bm-main { height: 74vh; height: 74dvh; }
  .bm-body { max-width: 100%; }
  .bm-row { gap: 10px; }
}
@media (max-width: 560px) {
  .bm-thread { padding: 16px 13px 10px; gap: 16px; }
  .bm-stack { max-width: 90%; }
  .bm-seg { align-self: stretch; }
  .bm-seg button { flex: 1; justify-content: center; padding: 7px 8px; }
  .bm-jump { bottom: 158px; right: 14px; }
  .bm-suggest { grid-template-columns: 1fr; }
  .bm-welcome h2 { font-size: 21px; }
  .bm-ava { width: 28px; height: 28px; flex-basis: 28px; }
}

/* ---------------- tabs (Chat | Cover letter) ---------------- */
.bm-tabs { display: inline-flex; gap: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; flex: 0 0 auto; }
.bm-tab { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border: none; background: none; color: var(--text-dim); font-size: 12.5px; font-weight: 650; padding: 6px 12px; border-radius: 7px; cursor: pointer; transition: background .14s, color .14s; }
.bm-tab svg { opacity: .85; }
.bm-tab:hover { color: var(--text); }
.bm-tab.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.bm-tab.active svg { opacity: 1; color: var(--brand); }

/* ---------------- live reasoning ("Thinking" -> "Thoughts") ---------------- */
.bm-reason { margin: 0 0 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.bm-reason-head { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: none; background: none; cursor: pointer; padding: 9px 12px; color: var(--text-dim); font-size: 12.5px; font-weight: 650; }
.bm-reason-head:hover { color: var(--text); }
.bm-reason-caret { display: grid; place-items: center; color: var(--text-faint); transform: rotate(-90deg); transition: transform .22s ease; }
.bm-reason.collapsed .bm-reason-caret { transform: rotate(180deg); }
.bm-reason-label { flex: 0 0 auto; }
.bm-reason-live { display: inline-flex; align-items: center; gap: 4px; margin-left: 1px; }
.bm-reason-live i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); opacity: .3; animation: bm-pulse 1.2s infinite ease-in-out; }
.bm-reason-live i:nth-child(2) { animation-delay: .18s; }
.bm-reason-live i:nth-child(3) { animation-delay: .36s; }
.bm-reason.collapsed .bm-reason-live, .bm-reason.settled .bm-reason-live { display: none; }
.bm-reason-body { max-height: 40vh; overflow-y: auto; overscroll-behavior: contain; transition: max-height .3s ease, opacity .25s ease; }
.bm-reason.collapsed .bm-reason-body { max-height: 0; opacity: 0; overflow: hidden; }
.bm-reason-text { padding: 2px 14px 12px 34px; font-size: 12.5px; line-height: 1.62; color: var(--text-faint); white-space: pre-wrap; word-break: break-word; }

/* ---------------- cover-letter mode ---------------- */
.bm-cover { flex: 1; min-height: 0; display: flex; }
.bm-cover-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.bm-cover-inner { max-width: 720px; margin: 0 auto; padding: 26px 22px 44px; }
.bm-cover-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.bm-cover-mark { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px; background: linear-gradient(150deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--brand) 70%, transparent); }
.bm-cover-hero h2 { margin: 0; font-size: 20px; font-weight: 740; }
.bm-cover-hero p { margin: 3px 0 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.bm-cover-form { display: flex; flex-direction: column; gap: 16px; }
.bm-cover-field { display: flex; flex-direction: column; gap: 8px; }
.bm-cover-field > label { font-size: 12px; font-weight: 700; letter-spacing: .01em; color: var(--text-dim); }
.bm-cover-input, .bm-cover-textarea { width: 100%; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; padding: 11px 13px; transition: border-color .14s, box-shadow .14s; }
.bm-cover-input:focus, .bm-cover-textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.bm-cover-textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.bm-cover-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 8px; }
.bm-cover-prof { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 13px; padding: 8px 11px; cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent; transition: border-color .16s ease, background .16s ease, transform .16s cubic-bezier(.2,.7,.3,1), box-shadow .16s ease; }
.bm-cover-prof::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .18s ease; background: radial-gradient(140px 70px at 100% 0, color-mix(in srgb, var(--pc, var(--brand)) 16%, transparent), transparent 72%); }
.bm-cover-prof:hover { border-color: color-mix(in srgb, var(--pc, var(--brand)) 55%, var(--border)); background: var(--surface-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.bm-cover-prof:hover::after { opacity: .7; }
.bm-cover-prof.active { border-color: var(--pc, var(--brand)); background: color-mix(in srgb, var(--pc, var(--brand)) 9%, var(--surface)); box-shadow: 0 0 0 1px var(--pc, var(--brand)), 0 10px 26px color-mix(in srgb, var(--pc, var(--brand)) 22%, transparent); }
.bm-cover-prof.active::after { opacity: 1; }
.bm-cover-prof-av { width: 31px; height: 31px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; letter-spacing: .03em; line-height: 1; color: var(--pc, var(--brand)); background: color-mix(in srgb, var(--pc, var(--brand)) 17%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--pc, var(--brand)) 32%, transparent); transition: background .16s ease, color .16s ease, box-shadow .16s ease; }
.bm-cover-prof.active .bm-cover-prof-av { color: #08110e; background: var(--pc, var(--brand)); border-color: transparent; box-shadow: 0 3px 10px color-mix(in srgb, var(--pc, var(--brand)) 45%, transparent); }
.bm-cover-prof-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.bm-cover-prof-name { font-size: 13px; font-weight: 700; letter-spacing: -.01em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-cover-prof-sub { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-cover-prof.active .bm-cover-prof-sub { color: var(--text-dim); }
.bm-cover-prof-check { position: absolute; top: 7px; right: 8px; width: 15px; height: 15px; border-radius: 50%; background: var(--pc, var(--brand)); display: grid; place-items: center; transform: scale(0); opacity: 0; transition: transform .18s cubic-bezier(.2,1.3,.4,1), opacity .12s ease; }
.bm-cover-prof.active .bm-cover-prof-check { transform: scale(1); opacity: 1; }
.bm-cover-prof-check svg { width: 9px; height: 9px; stroke: #08110e; stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bm-cover-empty, .bm-cover-hint { color: var(--text-faint); font-size: 12.5px; line-height: 1.5; padding: 4px 2px; }
.bm-cover-actions { display: flex; }
.bm-cover-write { gap: 8px; }
.bm-cover-result { margin-top: 22px; }
.bm-cover-out { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); animation: bm-rise .3s ease both; }
.bm-cover-out-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.bm-cover-out-title { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--text-dim); }
.bm-cover-out-title svg { color: var(--brand); }
.bm-cover-out-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.bm-cover-out-tools button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); font-size: 11.5px; font-weight: 600; padding: 5px 10px; border-radius: 8px; cursor: pointer; transition: .12s; }
.bm-cover-out-tools button:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.bm-cover-out-tools button.done { color: var(--brand-2); border-color: color-mix(in srgb, var(--brand-2) 45%, transparent); }
.bm-cover-out-body { padding: 16px; }
.bm-cover-skel { display: flex; flex-direction: column; gap: 11px; }
.bm-cover-skel span { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: bm-shimmer 1.4s ease infinite; }
.bm-cover-skel span:nth-child(1) { width: 94%; }
.bm-cover-skel span:nth-child(2) { width: 88%; }
.bm-cover-skel span:nth-child(3) { width: 96%; }
.bm-cover-skel span:nth-child(4) { width: 72%; }
.bm-cover-skel span:nth-child(5) { width: 84%; }
@keyframes bm-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (max-width: 560px) {
  .bm-cover-inner { padding: 18px 14px 32px; }
  .bm-cover-picker { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .bm-tab span { display: none; }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  .bm-row, .bm-welcome, .bm-jump, .bm-cover-out { animation: none; }
  .bm-thread { scroll-behavior: auto; }
  .bm-think .dot, .bm-cursor, .bm-searching svg, .bm-send.stop, .bm-reason-live i, .bm-cover-skel span { animation: none; }
  .bm-reason-body, .bm-reason-caret { transition: none; }
  .bm-send:hover, .bm-chip:hover, .bm-jump:hover, .bm-cover-prof:hover { transform: none; }
  .bm-cover-prof, .bm-cover-prof::after, .bm-cover-prof-av, .bm-cover-prof-check { transition: none; }
}

/* Cover letter: "Copy & open Upwork" button + optional-field hint */
.bm-cover-opt { font-weight: 400; font-size: 11px; color: var(--text-faint); margin-left: 6px; }
.bm-cover-out-tools .bm-cover-upwork { color: #14a800; }
.bm-cover-out-tools .bm-cover-upwork:hover { border-color: #14a800; background: color-mix(in srgb, #14a800 12%, transparent); }
