.widget-code-host {
  display: none;
  width: 100%;
  box-sizing: border-box;
  flex: 0 0 auto;
  min-height: 0;
}

main[data-view="design"] #col-design .widget-code-host[data-cs-mode="widget"] {
  display: flex;
  min-height: 0;
  animation: wcpHostIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes wcpHostIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Widget banner */
.cs-widget-banner {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.95rem;
  border-radius: 0.85rem;
  background: linear-gradient(
    135deg,
    rgba(var(--success-color-rgb, 34, 197, 94), 0.14),
    rgba(var(--primary-color-rgb), 0.12)
  );
  border: 1px solid rgba(var(--success-color-rgb, 34, 197, 94), 0.32);
  color: var(--text-color);
  box-sizing: border-box;
  font-family: "Outfit", sans-serif;
}

main[data-view="design"] #col-design[data-cs-mode="widget"] .cs-widget-banner {
  display: flex;
  animation: csWidgetBannerIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes csWidgetBannerIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cs-widget-banner-icon {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--success-color-rgb, 34, 197, 94), 0.22);
  color: var(--success-color, #16a34a);
  border: 1px solid rgba(var(--success-color-rgb, 34, 197, 94), 0.35);
}

.cs-widget-banner-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.cs-widget-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  font-size: 0.84rem;
  line-height: 1.35;
}

.cs-widget-banner-text strong {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-brand-green-ink-1c, var(--text-color));
}

.cs-widget-banner-sub {
  font-size: 0.74rem;
  font-weight: 450;
  color: var(--color-gray-600);
  letter-spacing: -0.005em;
}

/* Side-by-side layout in widget mode */
main[data-view="design"] #col-design[data-cs-mode="widget"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 36%);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "banner banner"
    "preview code";
  align-items: stretch;
}

main[data-view="design"] #col-design[data-cs-mode="widget"] .cs-widget-banner {
  grid-area: banner;
}

main[data-view="design"] #col-design[data-cs-mode="widget"] .company-settings-card {
  grid-area: preview;
  min-width: 0;
  min-height: 0;
}

main[data-view="design"] #col-design[data-cs-mode="widget"] .widget-code-host {
  grid-area: code;
  height: 100%;
  min-height: 0;
  align-self: stretch;
}

@media (max-width: 900px) {
  main[data-view="design"] #col-design[data-cs-mode="widget"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) minmax(220px, 40vh);
    grid-template-areas:
      "banner"
      "preview"
      "code";
  }
}

.widget-code-panel {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.wcp-window {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  background: var(--white-color);
  border: 1px solid rgba(var(--black-color-rgb), 0.08);
  border-radius: 0.95rem;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(var(--black-color-rgb), 0.04),
    0 8px 24px -14px rgba(var(--black-color-rgb), 0.12);
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

.wcp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  background: var(--color-neutral-off-white);
  border-bottom: 1px solid rgba(var(--black-color-rgb), 0.06);
  flex-shrink: 0;
}

.wcp-head-left {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.wcp-head-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.wcp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(var(--black-color-rgb), 0.18);
}

.wcp-dot--r { background: #ff6159; }
.wcp-dot--y { background: #ffbd2e; }
.wcp-dot--g { background: #29c93f; }

.wcp-filename {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--color-gray-500);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: "Outfit", sans-serif;
}

/* Green confirmation tint after a successful copy. Visuals come from
   ActionButton (.v-action-btn--secondary, --size-sm). */
.wcp-copy-btn.is-copied {
  background: rgba(var(--primary-color-rgb), 0.12);
  color: var(--color-brand-green-ink-1c);
  border-color: rgba(var(--primary-color-rgb), 0.4);
}

.wcp-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem 0;
  background:
    radial-gradient(circle at top right, rgba(var(--primary-color-rgb), 0.04), transparent 60%),
    var(--white-color);
}

.wcp-pre {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: 0.78rem;
  line-height: 1.7;
  white-space: pre;
  color: var(--text-color);
  font-family: inherit;
}

.wcp-line {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding: 0 1rem;
  position: relative;
  transition: background 0.15s ease;
}

.wcp-line:hover {
  background: rgba(var(--primary-color-rgb), 0.04);
}

.wcp-ln {
  flex: 0 0 auto;
  color: rgba(var(--black-color-rgb), 0.25);
  text-align: right;
  min-width: 1.6rem;
  font-size: 0.7rem;
  user-select: none;
  letter-spacing: -0.02em;
}

.wcp-code {
  flex: 1 1 auto;
  min-width: 0;
}

.wcp-tk--comment {
  color: #8a96a3;
  font-style: italic;
}

.wcp-tk--tag {
  color: #d6336c;
  font-weight: 600;
}

.wcp-tk--attr {
  color: #1971c2;
}

.wcp-tk--str {
  color: #c2410c;
}

.wcp-tk--punct {
  color: rgba(var(--black-color-rgb), 0.45);
}

.wcp-tk--space {
  color: inherit;
}

.wcp-tk--kw {
  color: #9333ea;
  font-weight: 600;
}

.wcp-tk--prop {
  color: #1971c2;
}

.wcp-tk--fn {
  color: #b35c00;
  font-weight: 600;
}

.wcp-tk--op {
  color: rgba(var(--black-color-rgb), 0.55);
  font-weight: 600;
}

.wcp-tk--num {
  color: #b35c00;
}

.wcp-tk--bool {
  color: #b35c00;
  font-weight: 600;
}

.wcp-indent {
  white-space: pre;
  color: rgba(var(--black-color-rgb), 0.12);
}

.wcp-foot {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  background: var(--color-neutral-off-white);
  border-top: 1px solid rgba(var(--black-color-rgb), 0.06);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-gray-500);
  letter-spacing: 0.02em;
  font-family: "Outfit", sans-serif;
  flex-shrink: 0;
}

.wcp-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.18);
  animation: wcpPulse 1.6s ease-in-out infinite;
}

@keyframes wcpPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.14); }
  50%      { box-shadow: 0 0 0 5px rgba(var(--primary-color-rgb), 0.05); }
}

.wcp-foot-spacer {
  flex: 1 1 auto;
}

.wcp-status-meta {
  color: var(--color-gray-500);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.wcp-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.wcp-body::-webkit-scrollbar-thumb {
  background: rgba(var(--black-color-rgb), 0.12);
  border-radius: 999px;
}

.wcp-body::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--black-color-rgb), 0.2);
}
