/* =========================================================
   Belz Calibration Laboratory — NABL Scope Assistant styles
   (scope search CTA in Disciplines section + chatbot widget)
   ========================================================= */

/* ── Scope search CTA (Disciplines section) ── */
.scope-search {
  max-width: 760px; margin: -24px auto 44px; padding: 22px 24px;
  background: linear-gradient(135deg, rgba(13,27,62,0.97), rgba(27,42,107,0.97));
  border: 1px solid rgba(212,175,55,0.35); border-radius: 14px;
  box-shadow: 0 10px 40px rgba(13,27,62,0.25); color: #fff;
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center;
}
.scope-search-icon {
  width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
  background: rgba(212,175,55,0.12); border: 1px solid rgba(212,175,55,0.35);
  display: flex; align-items: center; justify-content: center; color: var(--gold);
}
.scope-search-icon svg { width: 26px; height: 26px; }
.scope-search h4 { font-family: var(--ff-head); font-size: 19px; font-weight: 700; letter-spacing: 0.3px; }
.scope-search p { font-size: 13px; color: rgba(255,255,255,0.65); margin-top: 2px; }
.scope-search form { display: flex; gap: 8px; margin-top: 12px; }
.scope-search input {
  flex: 1; min-width: 0; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px; padding: 11px 14px; color: #fff; font-size: 14px; transition: border-color 0.2s;
}
.scope-search input::placeholder { color: rgba(255,255,255,0.4); }
.scope-search input:focus { outline: none; border-color: var(--gold); }
.scope-search button.btn-primary { padding: 11px 20px; white-space: nowrap; }
.scope-search-examples { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.scope-search-examples button {
  font-size: 11.5px; color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 20px; padding: 4px 11px; transition: var(--tr);
}
.scope-search-examples button:hover { border-color: var(--gold); color: var(--gold); }
@media (max-width: 640px) {
  .scope-search { grid-template-columns: 1fr; margin-top: -10px; padding: 18px; }
  .scope-search-icon { display: none; }
  .scope-search form { flex-direction: column; }
}

/* ── Chatbot widget ── */
#scopeChat { --sc-w: 400px; --sc-h: 620px; font-family: var(--ff-body); }
.sc-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 1200;
  display: flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px;
  background: linear-gradient(135deg, var(--gold), #b8860b); color: var(--navy);
  border-radius: 40px; font-weight: 700; font-size: 13.5px; letter-spacing: 0.2px;
  box-shadow: 0 8px 28px rgba(212,175,55,0.45); transition: var(--tr); cursor: pointer;
}
.sc-fab svg { width: 22px; height: 22px; }
.sc-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(212,175,55,0.55); }
.sc-fab.hidden { opacity: 0; pointer-events: none; transform: scale(0.9); }
.sc-fab::before {
  content: ''; position: absolute; inset: -4px; border-radius: 44px;
  border: 2px solid rgba(212,175,55,0.5); animation: sc-pulse 2.4s ease-out infinite;
}
@keyframes sc-pulse { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(1.25); opacity: 0; } }

.sc-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 1210;
  width: var(--sc-w); max-width: calc(100vw - 24px); height: var(--sc-h); max-height: calc(100vh - 40px);
  background: #fff; border-radius: 18px; box-shadow: 0 24px 70px rgba(8,15,36,0.35);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(20px) scale(0.98); pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.sc-panel.open { opacity: 1; transform: none; pointer-events: auto; }
.sc-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid)); color: #fff;
}
.sc-head-icon { width: 38px; height: 38px; border-radius: 10px; background: rgba(212,175,55,0.15); border: 1px solid rgba(212,175,55,0.4); display: flex; align-items: center; justify-content: center; color: var(--gold); flex-shrink: 0; }
.sc-head-icon svg { width: 20px; height: 20px; }
.sc-head-text { flex: 1; min-width: 0; }
.sc-head-title { font-family: var(--ff-head); font-size: 17px; font-weight: 700; letter-spacing: 0.4px; line-height: 1.1; }
.sc-head-sub { font-family: var(--ff-mono); font-size: 10px; color: rgba(255,255,255,0.55); letter-spacing: 0.6px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-close { width: 32px; height: 32px; border-radius: 8px; color: rgba(255,255,255,0.7); display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.sc-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sc-close svg { width: 16px; height: 16px; }

.sc-body { flex: 1; overflow-y: auto; padding: 16px 14px; background: var(--off-white); display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.sc-msg { display: flex; flex-direction: column; max-width: 100%; }
.sc-user { align-items: flex-end; }
.sc-bot { align-items: flex-start; }
.sc-bubble { max-width: 92%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; color: var(--dark-text); }
.sc-user .sc-bubble { background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.sc-bot .sc-bubble { background: #fff; border: 1px solid var(--gray-light); border-bottom-left-radius: 4px; max-width: 100%; width: 100%; }
.sc-bubble p { margin: 0 0 8px; }
.sc-bubble p:last-child { margin-bottom: 0; }
.sc-bubble em { color: var(--accent2); font-style: normal; font-weight: 600; }
.sc-yes { color: #166534; }
.sc-warn { color: #92400e; }
.sc-note { font-size: 11.5px; color: var(--gray-text); border-top: 1px dashed var(--gray-light); padding-top: 8px; margin-top: 10px !important; }
.sc-link { color: var(--accent2); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.sc-list { list-style: none; padding: 0; margin: 4px 0 8px; }
.sc-list li { padding: 3px 0; }

.sc-chiprow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sc-chip {
  font-size: 12px; font-weight: 500; color: var(--navy); background: #fff;
  border: 1px solid rgba(13,27,62,0.18); border-radius: 20px; padding: 5px 12px;
  transition: var(--tr); text-align: left;
}
.sc-chip small { color: var(--gray-text); font-size: 10.5px; margin-left: 2px; }
.sc-chip:hover { border-color: var(--gold); background: rgba(212,175,55,0.08); }
.sc-field { margin-top: 8px; }
.sc-field-name { font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.sc-field .sc-chiprow { margin-top: 5px; }

.sc-card { border: 1px solid var(--gray-light); border-radius: 10px; padding: 10px 12px; margin-top: 10px; background: #fff; }
.sc-card-hit { border-color: rgba(22,163,74,0.45); box-shadow: 0 0 0 3px rgba(22,163,74,0.08); }
.sc-card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.sc-disc { font-family: var(--ff-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--gray-text); flex: 1; min-width: 0; }
.sc-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; border-radius: 4px; padding: 2px 6px; text-transform: uppercase; }
.sc-badge-lab { background: rgba(0,119,204,0.1); color: var(--accent2); }
.sc-badge-site { background: rgba(212,175,55,0.15); color: #8a6a10; }
.sc-card-title { font-family: var(--ff-head); font-size: 15px; font-weight: 700; color: var(--navy); line-height: 1.25; }
.sc-method { font-size: 12px; color: var(--dark-text); margin-top: 5px; line-height: 1.45; }
.sc-method span { display: inline-block; font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--gray-text); margin-right: 6px; }
.sc-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.sc-table th { text-align: left; font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--gray-text); padding: 4px 6px 4px 0; border-bottom: 1px solid var(--gray-light); font-weight: 600; }
.sc-table td { padding: 6px 6px 6px 0; border-bottom: 1px solid #f0f2f7; vertical-align: top; }
.sc-table tr:last-child td { border-bottom: none; }
.sc-cmc { font-family: var(--ff-mono); color: var(--navy); font-weight: 600; white-space: nowrap; }
.sc-range { display: block; }
.sc-method-cell { display: block; font-size: 10.5px; color: var(--gray-text); line-height: 1.4; margin-top: 2px; }
.sc-ref { white-space: nowrap; text-align: right; }
.sc-sn { font-family: var(--ff-mono); font-size: 10px; color: var(--gray-text); margin-left: 4px; }
.sc-row-hit td { background: rgba(22,163,74,0.07); }
.sc-row-hit td:first-child { font-weight: 600; color: #166534; }
.sc-more { margin-top: 10px; }
/* discipline card answer: one collapsible row per scope measurand */
.sc-disc-item { margin-top: 6px; border-left: 2px solid rgba(212,175,55,0.45); padding-left: 8px; }
.sc-disc-item summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; line-height: 1.35; }
.sc-disc-item summary::marker { color: var(--gold); }
.sc-disc-range { font-family: var(--ff-mono); font-size: 10.5px; font-weight: 500; opacity: 0.75; }
.sc-disc-item .sc-card { margin-top: 6px; }
.sc-more summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--accent2); }

.sc-typing .sc-bubble { display: flex; gap: 4px; width: auto; padding: 12px 14px; }
.sc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--gray-text); opacity: 0.4; animation: sc-blink 1.2s infinite; }
.sc-typing span:nth-child(2) { animation-delay: 0.2s; }
.sc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes sc-blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.sc-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--gray-light); background: #fff; }
.sc-input input { flex: 1; min-width: 0; border: 1px solid var(--gray-light); border-radius: 10px; padding: 11px 14px; font-size: 14px; color: var(--dark-text); background: var(--off-white); transition: border-color 0.2s; }
.sc-input input:focus { outline: none; border-color: var(--gold); background: #fff; }
.sc-input button { width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px; background: linear-gradient(135deg, var(--gold), #b8860b); color: var(--navy); display: flex; align-items: center; justify-content: center; transition: var(--tr); }
.sc-input button:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(212,175,55,0.4); }
.sc-input button svg { width: 18px; height: 18px; }
.sc-foot { font-size: 10px; color: var(--gray-text); text-align: center; padding: 6px 12px 9px; background: #fff; font-family: var(--ff-mono); letter-spacing: 0.3px; }

@media (max-width: 640px) {
  .sc-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; border-radius: 0; }
  .sc-fab { right: 14px; bottom: 14px; padding: 12px 14px; }
  .sc-fab-label { display: none; }
  .sc-bubble { max-width: 96%; }
}
