/* Layout shell — tokens and message UI live in frame-ui.css (.ncf-root) */
.ncf-frame{display:grid;gap:16px;height:576px;max-height:85vh;transition:opacity 0.2s ease-out}
/* Hide frame until i18n and critical assets are ready to avoid flash of keys/images */
.ncf-frame.ncf-loading{opacity:0;pointer-events:none}
/* Fade in agent media when loaded */
.ncf-media-image img{transition:opacity 0.2s ease-out}
.ncf-media-image img.ncf-loaded{opacity:1}
.ncf-media-image img:not(.ncf-loaded){opacity:0}
/* Small images (carousel, explorer, list): fade in when loaded */
.ncf-img-fade{transition:opacity 0.2s ease-out}
.ncf-img-fade.ncf-loaded{opacity:1}
.ncf-img-fade:not(.ncf-loaded){opacity:0}

/* Desktop: three columns; auto-collapse via CSS grid if sections hidden */
@media (min-width: 1024px){
  .ncf-frame{grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: stretch}
  .ncf-frame.ncf-one{grid-template-columns: 1fr}
  .ncf-frame.ncf-two{grid-template-columns: 1fr 2fr}
  .ncf-frame.ncf-three{grid-template-columns: 1fr 1fr 1fr}
  .ncf-section{border:1px solid var(--ncw-border,#e5e7eb); border-radius:16px; overflow:hidden; background:var(--ncw-bg,#fff); height:100%; display:flex; flex-direction:column; min-height:0}
  .ncf-chat{display:flex;flex-direction:column;min-height:0}
  .ncf-messages{flex:1;overflow:auto;padding:12px;min-height:0;-webkit-overflow-scrolling:touch}
  .ncf-input{padding:8px 12px;display:flex;gap:8px;position:sticky;bottom:0;left:0;right:0;background:var(--ncw-bg,#fff);align-items:center;width:100%;z-index:1;box-sizing:border-box}
  .ncf-input input{flex:1;min-width:0;padding:9.6px 12px;border:1px solid #e5e7eb !important;border-radius:8px;background:#fff;box-sizing:border-box}
  .ncf-input .ncf-tool,
  .ncf-input .ncf-send,
  .ncf-input .ncf-lang{flex-shrink:0}
  .ncf-powered{display:block;margin:4px 12px 4px auto;font-size:12px;color:#cbd5e1;text-decoration:none;white-space:nowrap;opacity:0.7;transition:color .15s ease, opacity .15s ease}
  .ncf-powered:hover{color:#9ca3af;opacity:1;text-decoration:none}
  /* Meta ID overlay (top-right inside messages) */
  .ncf-messages{position:relative}
}
/* Hide desktop media pane on mobile */
.ncf-media-desktop{display:block}

/* Base meta ID overlay styling - applies to all screen sizes */
.ncf-meta{position:absolute;top:4px;right:12px;background:transparent;font-size:12px;line-height:1;color:#cbd5e1;opacity:0.7;white-space:nowrap;max-width:70%;overflow:hidden;text-overflow:ellipsis;pointer-events:none}

/* Mobile: stacked; chat first, configurator second */
@media (max-width: 1023.98px){
  .ncf-frame{grid-template-columns: 1fr}
  .ncf-frame{height:576px; overflow:hidden}
  .ncf-section{border:1px solid var(--ncw-border,#e5e7eb); border-radius:16px; overflow:hidden; background:var(--ncw-bg,#fff); height:576px; display:flex; flex-direction:column; min-height:0}
  .ncf-chat{position:relative;min-height:0;display:flex;flex-direction:column}
  .ncf-media-desktop{display:none}
  /* Mobile messages area - takes up available space */
  .ncf-messages{flex:1;overflow:auto;padding:12px;min-height:0;-webkit-overflow-scrolling:touch}
  /* Mobile input styling - stays at bottom */
  .ncf-input{padding:8px 12px;display:flex;gap:8px;position:sticky;bottom:0;left:0;right:0;background:var(--ncw-bg,#fff);align-items:center;width:100%;z-index:1;box-sizing:border-box;margin-top:auto}
  .ncf-input input{flex:1;min-width:0;padding:9.6px 12px;border:1px solid #e5e7eb !important;border-radius:8px;background:#fff;box-sizing:border-box}
  .ncf-input .ncf-tool,
  .ncf-input .ncf-send,
  .ncf-input .ncf-lang{flex-shrink:0}
  .ncf-powered{display:block;margin:4px 12px 4px auto;font-size:12px;color:#cbd5e1;text-decoration:none;white-space:nowrap;opacity:0.7;transition:color .15s ease, opacity .15s ease}
  .ncf-powered:hover{color:#9ca3af;opacity:1;text-decoration:none}
  /* Meta overlay adjustments on mobile */
  .ncf-meta{max-width:80%}
}

/* Mobile config-mode: show chat and configurator simultaneously, each scrolls internally */
@media (max-width: 1023.98px){
  .ncf-frame.config-mode{display:grid; grid-template-rows: 1fr 1fr; grid-template-columns: 1fr; height:576px; overflow:hidden}
  .ncf-frame.config-mode .ncf-section{height:auto; min-height:0}
  .ncf-frame.config-mode .ncf-chat{display:flex; flex-direction:column; min-height:0}
  .ncf-frame.config-mode .ncf-messages{flex:1; overflow:auto}
  .ncf-frame.config-mode .ncf-config{display:flex; flex-direction:column; min-height:0}
}

/* Stacked layout: narrow viewport (media above) or compact chat widget (class set in frame-core) */
.ncf-frame.ncf-layout-stacked{grid-template-columns:1fr !important;gap:0}
.ncf-frame.ncf-layout-stacked .ncf-media-desktop{display:none !important}
.ncf-frame.ncf-layout-stacked.config-mode{display:grid;grid-template-rows:1fr 1fr;grid-template-columns:1fr !important;height:576px;overflow:hidden}
.ncf-frame.ncf-layout-stacked.config-mode .ncf-section{height:auto;min-height:0}
.ncf-frame.ncf-layout-stacked.config-mode .ncf-chat{display:flex;flex-direction:column;min-height:0}
.ncf-frame.ncf-layout-stacked.config-mode .ncf-messages{flex:1;overflow:auto}
.ncf-frame.ncf-layout-stacked.config-mode .ncf-config{display:flex;flex-direction:column;min-height:0}

.ncf-banner{margin:8px 8px 0; padding:8px; background:#eff6ff; border:1px solid #bfdbfe; border-radius:8px; font-size:14px; color:#1e3a8a}
.ncf-banner a{color:inherit;text-decoration:underline;font-weight:600}
.ncf-banner a:hover{color:#1d4ed8}
.ncf-banner.hidden{display:none}
.ncf-section.hidden{display:none}
/* Hidden explorer must not take layout space (it shares panel with configurator) */
.ncf-explorer.hidden{display:none !important}
.ncf-frame.config-mode{height:576px; max-height:85vh}
.ncf-loading{padding:4px 8px; font-size:14px; color:#6b7280}

/* Loading dots (Safari-safe: plain CSS, no mask/SVG animation) */
.ncf-loading-dots{display:inline-flex;align-items:center;gap:4px;padding:5.6px 0}
.ncf-loading-dots i{display:block;width:6px;height:6px;border-radius:50%;background:currentColor;opacity:0.4;animation:ncf-dot-bounce 1.05s ease-in-out infinite}
.ncf-loading-dots i:nth-child(2){animation-delay:0.1s}
.ncf-loading-dots i:nth-child(3){animation-delay:0.2s}
@keyframes ncf-dot-bounce{0%,60%,100%{transform:translateY(0);opacity:0.4}30%{transform:translateY(-5px);opacity:1}}
@-webkit-keyframes ncf-dot-bounce{0%,60%,100%{transform:translateY(0);-webkit-transform:translateY(0);opacity:0.4}30%{transform:translateY(-5px);-webkit-transform:translateY(-5px);opacity:1}}

/* Avoid inner borders that create a double-border look */
.ncf-chat .ncf-banner{border:0 !important}
/* Ensure configurator panel doesn't have its own border when inside ncf-config */
.ncf-config .ncf-section{border:0 !important}

/* Config panel: fill section height so carousel centers and list view gets proper space (fixes mobile) */
.ncf-config{min-width:0; flex:1; min-height:0; display:flex; flex-direction:column; overflow:hidden}
.ncf-config .ncf-config-views{min-width:0; flex:1; min-height:0; overflow:hidden; display:flex; flex-direction:column}
.ncf-config-carousel-view{min-width:0; max-width:100%; overflow:hidden; flex:1; min-height:0; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:16px}
.ncf-configurator{min-width:0; overflow:hidden; flex:1; min-height:0; display:flex; flex-direction:column}
/* Feature carousel: spacing only (no card border) */
.ncf-config-carousel-feature{
  width:100%; max-width:280px;
  padding:20px;
  background:var(--ncw-bg,#fff);
  box-sizing:border-box;
  gap:4px;
}
.ncf-config-carousel-feature .ncf-config-carousel-img{margin-bottom:18px}
/* Feature image: border and rounded corners */
.ncf-config-carousel-img{
  border:1px solid var(--ncw-border,#e5e7eb);
  box-sizing:border-box;
}
/* List view: features list takes all space, total cost stays compact at bottom */
.ncf-config-list-view{flex:1; min-height:0; display:flex; flex-direction:column; overflow:hidden}
.ncf-config-list-view .ncf-total-cost{flex-shrink:0}

/* Carousel feature image: smaller on mobile */
@media (max-width: 1023.98px){
  .ncf-config-carousel-img{width:88px !important;height:88px !important}
  .ncf-config-carousel-feature{padding:16px; max-width:100%}
}
.ncf-media-image img{width:100%;height:100%;object-fit:cover;display:block}
.ncf-media.ncf-section{border:1px solid var(--ncw-border,#e5e7eb) !important}

/* Sources block: shown below answer, smaller and muted */
.ncf-root .sources-block {
  font-size: 0.875em;
  margin-top: 1em;
  color: #6b7280;
}

/* Explorer product / product-line thumbnails.
   List geometry stays fixed; a floating preview shows the larger image. */
.ncf-explore-thumb{
  width:40px;
  height:40px;
  border-radius:4px;
  background:var(--ncw-bg,#fff);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  flex-shrink:0;
  position:relative;
  z-index:1;
  transition:box-shadow .15s ease;
}
.ncf-explore-thumb--sm{
  width:32px;
  height:32px;
}
.ncf-explore-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.ncf-explore-explain{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  flex:1;
  cursor:pointer;
}
.ncf-explore-explain:hover .ncf-explore-thumb{
  box-shadow:0 0 0 2px rgba(15,23,42,0.10);
}
.ncf-explore-preview{
  position:fixed;
  left:-9999px;
  top:-9999px;
  width:136px;
  height:136px;
  border-radius:8px;
  overflow:hidden;
  background:var(--ncw-bg,#fff);
  border:1px solid rgba(15,23,42,0.08);
  box-shadow:0 12px 32px rgba(15,23,42,0.22);
  z-index:10000;
  opacity:0;
  pointer-events:none;
  transform:scale(0.94);
  transition:opacity .14s ease, transform .14s ease;
}
.ncf-explore-preview.is-visible{
  opacity:1;
  transform:scale(1);
}
.ncf-explore-preview img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* Panel headers (Products explorer, configurator) */
.ncf-panel-title{
  padding:13.6px 16px;
  border-bottom:1px solid var(--ncw-border,#e5e7eb);
  display:flex;
  align-items:center;
  gap:10.4px;
  flex-shrink:0;
  min-width:0;
  background:var(--ncw-bg,#fff);
  overflow:visible;
}
.ncf-panel-title-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:1.28px;
  flex:1;
  overflow:visible;
}
.ncf-panel-title-label{
  display:block;
  font-size:15.2px;
  font-weight:600;
  letter-spacing:-0.015em;
  line-height:1.25;
  color:#0f172a;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.ncf-panel-title-desc{
  font-size:12px;
  font-weight:400;
  letter-spacing:0;
  line-height:1.35;
  color:#94a3b8;
  overflow:hidden;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}
.ncf-panel-title .ncf-icon{
  flex-shrink:0;
}
.ncf-panel-title > .ncf-icon:last-child{
  margin-left:auto;
}

.ncf-explore-name{
  font-weight:600;
  letter-spacing:-0.01em;
  color:#0f172a;
  display:inline-block;
  line-height:1.3;
}
.ncf-explore-name--muted{
  font-weight:500;
  font-size:14px;
  color:#6b7280;
}
.ncf-explore-label{
  display:flex;
  flex-direction:column;
  gap:0.8px;
  min-width:0;
}
.ncf-explore-manufacturer{
  font-size:12px;
  font-weight:400;
  line-height:1.25;
  color:#94a3b8;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
/* Explorer header: switch between products and solutions, on the title's line right after it */
.ncf-panel-title-row{
  display:flex;
  align-items:center;
  gap:10.4px;
  min-width:0;
}
.ncf-explore-switch{
  display:inline-flex;
  flex-shrink:0;
  gap:2px;
  padding:2.4px;
  border-radius:9999px;
  background:#eef2f7;
}
.ncf-explore-switch-btn{
  padding:4px 11.2px;
  border:none;
  border-radius:9999px;
  background:transparent;
  color:#64748b;
  font:inherit;
  font-size:12px;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
  cursor:pointer;
  transition:background .15s ease, color .15s ease, box-shadow .15s ease;
}
.ncf-explore-switch-btn:hover{
  color:#0f172a;
}
.ncf-explore-switch-btn.is-active{
  background:var(--ncw-bg,#fff);
  color:#0f172a;
  box-shadow:0 1px 2px rgba(15,23,42,0.08);
  cursor:default;
}
.ncf-explore-switch-btn:focus-visible{
  outline:2px solid #93c5fd;
  outline-offset:2px;
}

/* Explorer product list toggle for large product lines */
.ncf-products-toggle{
  align-self:flex-start;
  margin-left:16px;
  margin-top:2px;
  padding:0;
  border:none;
  border-radius:0;
  background:transparent;
  color:#6b7280;
  font-size:12px;
  font-weight:500;
  line-height:1;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:5.6px;
  transition:color .15s ease;
}
.ncf-products-toggle:hover{
  color:#374151;
}
.ncf-products-toggle:focus-visible{
  outline:2px solid #93c5fd;
  outline-offset:2px;
}
.ncf-products-toggle-chevron{
  width:12px;
  height:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition:transform .15s ease;
}
.ncf-products-toggle.is-expanded .ncf-products-toggle-chevron{
  transform:rotate(180deg);
}
.ncf-products-toggle-chevron svg{
  width:100%;
  height:100%;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.ncf-products-toggle-label{
  line-height:1;
}

/* Compare pairing in the products explorer — quiet until invited */
.ncf-explore-row-actions{
  display:inline-flex;
  align-items:center;
  gap:2.4px;
  margin-left:auto;
  flex-shrink:0;
}
/* Space between the vs toggle and the URL / configurator button before it */
.ncf-explore-row-actions > * + .ncf-compare-toggle{
  margin-left:6.4px;
}
.ncf-explore-pair{
  border-radius:8.8px;
  transition:background .22s ease, box-shadow .22s ease;
}
.ncf-explore-pair.is-glowing{
  background:rgba(141, 183, 240, 0.12);
  box-shadow:0 0 0 1px rgba(63, 111, 174, 0.22), 0 0 14px -4px rgba(141, 183, 240, 0.55);
}
.ncf-explore-pair.is-pairing{
  background:rgba(141, 183, 240, 0.10);
  box-shadow:0 0 0 1px rgba(63, 111, 174, 0.16), 0 0 10px -4px rgba(141, 183, 240, 0.4);
}
.ncf-panel-title-desc--pair{
  color:#3f6fae !important;
  -webkit-line-clamp:2;
}
.ncf-compare-toggle{
  min-width:28px;
  height:28px;
  padding:0 4.8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin:0;
  border:0;
  background:transparent;
  border-radius:7.2px;
  cursor:pointer;
  color:#94a3b8;
  opacity:0;
  flex-shrink:0;
  -webkit-appearance:none;
  appearance:none;
  transition:color .18s ease, background .18s ease, opacity .18s ease, box-shadow .18s ease;
}
.ncf-explore-pair:hover .ncf-compare-toggle,
.ncf-compare-toggle:focus-visible,
.ncf-compare-toggle.is-selected,
.ncf-compare-toggle.is-complement{
  opacity:1;
}
/* While pairing, keep valid complements visible without requiring hover */
.ncf-explorer.is-pairing .ncf-compare-toggle.is-complement,
.ncf-explorer.is-pairing .ncf-compare-toggle.is-selected{
  opacity:1;
}
.ncf-compare-toggle:hover{
  color:#64748b;
  background:transparent;
  box-shadow:0 0 0 2px rgba(15,23,42,0.10);
}
.ncf-compare-toggle:focus-visible{
  outline:none;
  box-shadow:0 0 0 2px rgba(15,23,42,0.10);
}
.ncf-compare-toggle.is-selected:hover,
.ncf-compare-toggle.is-complement:hover{
  color:#3f6fae;
  background:rgba(141, 183, 240, 0.12);
  box-shadow:0 0 0 1px rgba(63, 111, 174, 0.2), 0 0 10px -2px rgba(141, 183, 240, 0.45);
}
.ncf-compare-toggle.is-selected{
  color:#3f6fae;
  background:rgba(141, 183, 240, 0.16);
  box-shadow:0 0 0 1px rgba(63, 111, 174, 0.2), 0 0 10px -2px rgba(141, 183, 240, 0.5);
}
.ncf-compare-toggle.is-complement{
  color:#3f6fae;
  background:rgba(141, 183, 240, 0.10);
  box-shadow:0 0 0 1px rgba(63, 111, 174, 0.14);
}
.ncf-compare-toggle-vs{
  display:block;
  font-family:ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size:11px;
  font-weight:700;
  letter-spacing:0.02em;
  line-height:1;
  text-transform:lowercase;
  user-select:none;
}
@media (prefers-reduced-motion: reduce){
  .ncf-explore-pair{transition:none}
}
