/* Syntax token colors + optional editable overlay (docs try-it console). */

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #64748b;
}

.token.punctuation {
  color: #94a3b8;
}

.token.namespace {
  opacity: .85;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #f472b6;
}

/*
 * Prism marks HTML tags as class="token tag". Never inherit chip/pill chrome
 * from design-system `.tag` (or any future chip rule that targets `.tag`).
 */
.token.tag {
  display: inline !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  gap: 0 !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  font-family: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  vertical-align: baseline !important;
  white-space: inherit !important;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #86efac;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #7dd3fc;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #c4b5fd;
}

.token.function,
.token.class-name {
  color: #fcd34d;
}

.token.regex,
.token.important,
.token.variable {
  color: #fdba74;
}

.token.important,
.token.bold {
  font-weight: 700;
}

.token.italic {
  font-style: italic;
}

/*
 * Kill remaining design-system collisions inside Prism overlays
 * (padding / display on bare `.token`, not just `.tag`).
 */
.bp-code-hl .token,
.bp-code-hl .tag,
.dev-code .token,
.dev-code .tag,
[data-bp-highlight] .token,
[data-bp-highlight] .tag,
.bp-el-code-console .token,
.bp-el-code-console .tag {
  display: inline !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  font-family: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  vertical-align: baseline !important;
  white-space: inherit !important;
  gap: 0 !important;
}

.bp-code-hl .token.tag,
.dev-code .token.tag,
[data-bp-highlight] .token.tag,
.bp-el-code-console .token.tag {
  color: #f472b6 !important;
}

.bp-code-hl .token.attr-name,
.dev-code .token.attr-name,
[data-bp-highlight] .token.attr-name,
.bp-el-code-console .token.attr-name {
  color: #86efac !important;
}

.bp-code-hl .token.attr-value,
.dev-code .token.attr-value,
[data-bp-highlight] .token.attr-value,
.bp-el-code-console .token.attr-value {
  color: #c4b5fd !important;
}

.bp-code-hl .token.punctuation,
.dev-code .token.punctuation,
[data-bp-highlight] .token.punctuation,
.bp-el-code-console .token.punctuation {
  color: #94a3b8 !important;
}

.bp-code-hl .token.comment,
.dev-code .token.comment,
[data-bp-highlight] .token.comment,
.bp-el-code-console .token.comment {
  color: #64748b !important;
}

.bp-code-hl .token.string,
.dev-code .token.string,
[data-bp-highlight] .token.string,
.bp-el-code-console .token.string {
  color: #86efac !important;
}

.bp-code-hl .token.keyword,
.dev-code .token.keyword,
[data-bp-highlight] .token.keyword,
.bp-el-code-console .token.keyword {
  color: #c4b5fd !important;
}

.bp-code-hl .token.function,
.dev-code .token.function,
[data-bp-highlight] .token.function,
.bp-el-code-console .token.function {
  color: #fcd34d !important;
}

.bp-code-hl .token.number,
.dev-code .token.number,
[data-bp-highlight] .token.number,
.bp-el-code-console .token.number {
  color: #f472b6 !important;
}

.bp-code-hl .token.operator,
.dev-code .token.operator,
[data-bp-highlight] .token.operator {
  color: #7dd3fc !important;
}

/* Docs samples: base text color, tokens override via rules above */
.dev-code code,
.dev-section .dev-code code {
  color: #e2e8f0 !important;
}

.dev-code code .token.comment,
.dev-code code .token.prolog,
.dev-code code .token.doctype,
.dev-code code .token.cdata { color: #64748b; }
.dev-code code .token.punctuation { color: #94a3b8; }
.dev-code code .token.property,
.dev-code code .token.tag,
.dev-code code .token.boolean,
.dev-code code .token.number,
.dev-code code .token.constant,
.dev-code code .token.symbol,
.dev-code code .token.deleted { color: #f472b6; }
.dev-code code .token.selector,
.dev-code code .token.attr-name,
.dev-code code .token.string,
.dev-code code .token.char,
.dev-code code .token.builtin,
.dev-code code .token.inserted { color: #86efac; }
.dev-code code .token.operator,
.dev-code code .token.entity,
.dev-code code .token.url { color: #7dd3fc; }
.dev-code code .token.atrule,
.dev-code code .token.attr-value,
.dev-code code .token.keyword { color: #c4b5fd; }
.dev-code code .token.function,
.dev-code code .token.class-name { color: #fcd34d; }
.dev-code code .token.regex,
.dev-code code .token.important,
.dev-code code .token.variable { color: #fdba74; }

/* Editable try-it / page HTML: surface grid + optional lint status */
.bp-code-hl {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.bp-code-hl-row {
  display: flex;
  flex: 1 1 auto;
  flex-direction: row;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  width: 100%;
}

.bp-code-hl-gutter {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: calc(var(--bp-code-gutter-digits, 2) * 1ch + 1.35rem);
  margin: 0;
  padding: .85rem .45rem .85rem .55rem;
  overflow: hidden;
  border-right: 1px solid color-mix(in srgb, #94a3b8 18%, transparent);
  background: color-mix(in srgb, #0f172a 78%, #1e293b);
  color: #64748b;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
  text-align: right;
  user-select: none;
  pointer-events: none;
  scrollbar-width: none;
}

.bp-code-hl-gutter::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.bp-code-hl-gutter[hidden] {
  display: none !important;
}

.bp-code-hl-gutter-inner {
  display: block;
  min-height: 100%;
}

.bp-code-hl-ln {
  display: block;
  box-sizing: border-box;
  height: 1.55em;
  line-height: 1.55;
  white-space: nowrap;
  overflow: hidden;
}

/* Soft-wrap: JS sets per-line height so #N stays aligned with logical line N (VS Code style). */
.bp-code-hl.is-wrap .bp-code-hl-ln {
  height: auto;
  min-height: 1.55em;
}

.bp-code-hl-surface {
  position: relative;
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
}

.bp-code-hl-surface > .bp-code-hl-pre,
.bp-code-hl-surface > .bp-code-lint,
.bp-code-hl-surface > textarea {
  grid-area: 1 / 1;
  margin: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 0;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
  font-size: .8125rem;
  line-height: 1.55;
  letter-spacing: normal;
  word-spacing: normal;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  padding: .85rem 1rem 1rem;
}

.bp-code-hl.is-wrap .bp-code-hl-surface > .bp-code-hl-pre,
.bp-code-hl.is-wrap .bp-code-hl-surface > .bp-code-lint,
.bp-code-hl.is-wrap .bp-code-hl-surface > textarea {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-x: hidden;
}

.bp-code-hl-surface > .bp-code-hl-pre {
  z-index: 0;
  pointer-events: none;
  background: transparent;
  color: #e2e8f0;
}

.bp-code-hl-surface > .bp-code-hl-pre code {
  display: block;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-variant-ligatures: none;
  line-height: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
  background: transparent !important;
  color: inherit;
  padding: 0 !important;
  margin: 0;
  border-radius: 0;
  box-shadow: none !important;
  white-space: inherit;
  tab-size: inherit;
}

.bp-code-hl-surface > .bp-code-lint {
  z-index: 1;
  position: relative;
  pointer-events: none;
  overflow: auto;
  color: transparent;
  background: transparent;
  scrollbar-width: none;
}

.bp-code-hl-surface > .bp-code-lint::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.bp-code-lint-inner {
  position: relative;
  width: 100%;
  min-width: 100%;
  pointer-events: none;
}

.bp-code-lint-mark {
  position: absolute;
  height: 3px;
  border-radius: 1px;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      -60deg,
      transparent 0 2px,
      #f87171 2px 4px
    );
  box-shadow: 0 0 0 1px color-mix(in srgb, #f87171 35%, transparent);
}

.bp-code-lint-status {
  flex: 0 0 auto;
  margin: 0;
  padding: .35rem .75rem;
  border-top: 1px solid color-mix(in srgb, #f87171 45%, transparent);
  background: color-mix(in srgb, #7f1d1d 88%, #0f172a);
  color: #fecaca;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
  font-size: .7rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bp-code-hl-surface > textarea,
.bp-code-hl-surface > textarea.bp-code-hl-ta,
.bp-code-hl-surface > textarea.dev-tryit-code {
  z-index: 2;
  resize: vertical;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: #e2e8f0;
  outline: none;
  font-variant-ligatures: none;
}

.bp-code-hl-surface > textarea::placeholder {
  color: #64748b;
  -webkit-text-fill-color: #64748b;
}

.bp-code-hl-surface > textarea::selection {
  background: color-mix(in srgb, var(--c-primary, #3b82f6) 45%, transparent);
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.dev-tryit-editor .bp-code-hl {
  min-height: 14rem;
}

.dev-tryit-editor .bp-code-hl-row,
.dev-tryit-editor .bp-code-hl-surface,
.dev-tryit-editor .bp-code-hl-surface > .bp-code-hl-pre,
.dev-tryit-editor .bp-code-hl-surface > .bp-code-lint,
.dev-tryit-editor .bp-code-hl-surface > .dev-tryit-code {
  min-height: 14rem;
}

.dev-tryit-editor .bp-code-hl-surface > .dev-tryit-code:focus {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--dev-primary) 45%, transparent);
}
