.bf-algorithm-article { min-width: 0; }
.single .entry-content .bf-algorithm-article > :is(p, ul, ol, dl, figure, table, blockquote),
.single .entry-content .bf-algorithm-article :is(.bftp-shared-explanation, .bftp-article-explanation) > :is(p, ul, ol, dl, figure, table, blockquote) { margin-top: 0; margin-bottom: 16px; }
.single .entry-content .bf-algorithm-article :is(h2, h3, h4) { margin-top: 32px; margin-bottom: 12px; }
.single .entry-content .bf-algorithm-article > :first-child { margin-top: 0; }
.bf-algorithm-article p:empty { display: none; }
.bf-algorithm-article .bftp-solutions { margin: 32px 0; padding: 20px; border: 1px solid #c6cbd2; background: #fff; color: #20242b; }
.bf-algorithm-article .bftp-solutions > summary { min-height: 44px; padding: 8px 0; font-size: 18px; font-weight: 500; line-height: 1.5; cursor: pointer; }
.bf-algorithm-article .bftp-solutions[open] > summary { margin-bottom: 16px; }
.bf-algorithm-article .bftp-solutions :focus-visible { outline: 2px solid #315b8c; outline-offset: 3px; }
.bf-algorithm-article .bftp-article-explanation { margin-top: 24px; }
.bf-algorithm-article .bftp-local-practice { margin: 24px 0; padding: 16px; border: 1px solid #c6cbd2; background: #fff; color: #20242b; }
.bf-algorithm-article .bftp-local-practice > summary { min-height: 44px; padding: 8px 0; font-size: 16px; font-weight: 500; line-height: 1.5; cursor: pointer; }
.bf-algorithm-article .bftp-local-practice[open] > summary { margin-bottom: 16px; }
.single .entry-content .bf-algorithm-article .bftp-article-explanation .bf-code-block { border: 1px solid #c6cbd2; background: #f6f7f9; color: #20242b; }
.bf-algorithm-article .bftp-article-explanation .bf-code-block__toolbar { border: 0; background: #fff; color: #20242b; }
.bf-algorithm-article .bftp-article-explanation :is(.bf-code-block__language, .bf-code-block__copy) { color: #20242b; }
/* Override the legacy theme's important dark background for light syntax colors. */
.single .entry-content .bf-algorithm-article .bftp-original-code { max-height: none; overflow-x: auto; overflow-y: hidden; background: #f6f7f9 !important; color: #20242b; font: 15px/27px Consolas, 'Courier New', monospace; white-space: pre; tab-size: 2; }
.bf-algorithm-article .bftp-original-code code { color: inherit; font: inherit; white-space: pre; overflow-wrap: normal; text-shadow: none; }
#bf-triangle-practice { margin: 32px 0; color: #20242b; font: inherit; }
#bf-triangle-practice *, #bf-triangle-practice *::before, #bf-triangle-practice *::after { box-sizing: border-box; }
#bf-triangle-practice [hidden] { display: none !important; }
#bf-triangle-practice h2 { margin: 0 0 12px; font-size: 22px; font-weight: 700; line-height: 1.5; }
#bf-triangle-practice h3 { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
#bf-triangle-practice .bftp-intro { margin: 0 0 16px; font-size: 15px; line-height: 1.8; }
#bf-triangle-practice .bftp-language-tabs, .bf-algorithm-article .bftp-solution-tabs { display: flex; gap: 8px; max-width: 100%; overflow-x: auto; padding: 4px; margin: 0 0 16px; scrollbar-width: thin; }
#bf-triangle-practice .bftp-language-tab, .bf-algorithm-article .bftp-solution-tabs button { flex: 0 0 auto; min-height: 44px; padding: 10px 14px; border: 1px solid #c6cbd2; border-radius: 0; box-shadow: none; background: #fff; color: #20242b; font: inherit; font-size: 14px; font-weight: 500; line-height: 1.5; white-space: nowrap; cursor: pointer; }
#bf-triangle-practice .bftp-language-tab[aria-selected="true"], .bf-algorithm-article .bftp-solution-tabs button[aria-selected="true"] { border-color: #20242b; background: #20242b; color: #fff; }
#bf-triangle-practice .bftp-language-tab:disabled, .bf-algorithm-article .bftp-solution-tabs button:disabled { opacity: .6; cursor: wait; }
.bf-algorithm-article .bftp-solution-panel[hidden] { display: none !important; }
.single .entry-content .bf-algorithm-article .bftp-solution-panel .bftp-code-block { margin: 0; border: 1px solid #c6cbd2; background: #f6f7f9; color: #20242b; }
.bf-algorithm-article .bftp-code-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 8px 16px; background: #fff; font-size: 13px; }
.bf-algorithm-article [data-bftp-copy] { flex-shrink: 0; min-height: 44px; padding: 8px 12px; border: 1px solid #c6cbd2; border-radius: 0; box-shadow: none; background: #fff; color: #20242b; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.bf-algorithm-article [data-bftp-copy]:disabled { opacity: .6; cursor: wait; }
.single .entry-content .bf-algorithm-article .bftp-solution-panel pre { max-width: 100%; margin: 0; padding: 16px; border: 0; border-radius: 0; box-shadow: none; overflow-x: auto; overflow-y: hidden; background: #f6f7f9; color: #20242b; font: 15px/27px Consolas, 'Courier New', monospace; white-space: pre; tab-size: 2; }
.single .entry-content .bf-algorithm-article .bftp-solution-panel pre code { display: block; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 400; white-space: pre; overflow-wrap: normal; word-break: normal; text-shadow: none; }
.single .entry-content .bf-algorithm-article .bftp-copy-status { margin: 0; padding: 0 16px 12px; font-size: 13px; line-height: 1.8; color: #59616d; }
/* Answer surfaces use a light syntax palette, independent of the legacy dark theme. */
.single .entry-content .bf-algorithm-article .bftp-solutions pre > code { color: #20242b; font: inherit; font-weight: 400; text-shadow: none; }
.single .entry-content .bf-algorithm-article .bftp-solutions .token { color: inherit; background: transparent; text-shadow: none; }
.single .entry-content .bf-algorithm-article .bftp-solutions :is(.token.comment, .token.prolog, .token.doctype, .token.cdata) { color: #5c626b; font-style: normal; }
.single .entry-content .bf-algorithm-article .bftp-solutions .token.punctuation { color: #4c525b; }
.single .entry-content .bf-algorithm-article .bftp-solutions :is(.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted) { color: #8b3b20; }
.single .entry-content .bf-algorithm-article .bftp-solutions :is(.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted) { color: #23603d; }
.single .entry-content .bf-algorithm-article .bftp-solutions :is(.token.operator, .token.entity, .token.url) { color: #7f2d53; }
.single .entry-content .bf-algorithm-article .bftp-solutions :is(.token.atrule, .token.attr-value, .token.keyword) { color: #663399; }
.single .entry-content .bf-algorithm-article .bftp-solutions :is(.token.function, .token.class-name) { color: #1f5c8a; }
.single .entry-content .bf-algorithm-article .bftp-solutions :is(.token.regex, .token.important, .token.variable) { color: #79521a; }
.single .entry-content .bf-algorithm-article .bftp-solutions pre { scrollbar-width: thin; scrollbar-color: #9ba3ad #e9edf1; }
.single .entry-content .bf-algorithm-article .bftp-solutions pre::-webkit-scrollbar { height: 8px; }
.single .entry-content .bf-algorithm-article .bftp-solutions pre::-webkit-scrollbar-track { background: #e9edf1; border-radius: 0; }
.single .entry-content .bf-algorithm-article .bftp-solutions pre::-webkit-scrollbar-thumb { background: #9ba3ad; border-radius: 0; }
.single .entry-content .bf-algorithm-article .bftp-solutions pre::selection,
.single .entry-content .bf-algorithm-article .bftp-solutions pre ::selection { background: #dce5ef; color: #17212c; }
@media (max-width: 640px) {
  .single .entry-content .bf-algorithm-article .bftp-solutions :is(.bftp-original-code, .bftp-solution-panel pre) { padding: 14px 12px; }
}
#bf-triangle-practice .bftp-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; font-size: 13px; }
#bf-triangle-practice .bftp-meta label { font-weight: 700; }
#bf-triangle-practice .bftp-meta label span { margin-left: 10px; font-weight: 500; color: #59616d; }
#bf-triangle-practice .bftp-count { font-variant-numeric: tabular-nums; color: #59616d; }
#bf-triangle-practice .bftp-editor { display: flex; margin: 0; border: 1px solid #c6cbd2; background: #f6f7f9; }
#bf-triangle-practice .bftp-source { position: relative; flex: 1; min-width: 0; height: 232px; min-height: 160px; max-height: 720px; margin: 0; overflow: hidden; resize: vertical; background: transparent; }
#bf-triangle-practice .bftp-caret { position: absolute; z-index: 2; width: 2px; background: #005fcc; pointer-events: none; }
#bf-triangle-practice .bftp-caret-measure { position: absolute; inset: 0 auto auto 0; width: max-content; margin: 0; border: 0; visibility: hidden; white-space: pre; tab-size: 2; pointer-events: none; }
#bf-triangle-practice .bftp-code, #bf-triangle-practice .bftp-highlight, #bf-triangle-practice .bftp-highlight code, #bf-triangle-practice .bftp-gutter {
  margin: 0; border: 0; border-radius: 0; box-shadow: none; font: 14px/24px Consolas, 'Courier New', monospace;
  font-weight: 400; letter-spacing: normal; text-align: left; text-shadow: none; white-space: pre; tab-size: 2;
}
#bf-triangle-practice .bftp-code, #bf-triangle-practice .bftp-highlight { position: absolute; inset: 0; width: 100%; height: 100%; padding: 16px; overflow: auto; scrollbar-width: thin; }
#bf-triangle-practice .bftp-highlight { pointer-events: none; scrollbar-width: none; background: transparent; color: #20242b; }
#bf-triangle-practice .bftp-highlight code { padding: 0; background: transparent; color: inherit; display: block; min-width: max-content; }
#bf-triangle-practice .bftp-code { z-index: 1; resize: none; background: #f6f7f9; color: #20242b; caret-color: #005fcc; cursor: text; }
#bf-triangle-practice.bftp-highlight-ready .bftp-code { color: transparent; background: transparent; -webkit-text-fill-color: transparent; }
#bf-triangle-practice .bftp-code::selection { background: #bed1ed; -webkit-text-fill-color: #172133; }
#bf-triangle-practice .bftp-gutter { width: 46px; height: 232px; padding: 16px 8px; flex-shrink: 0; overflow: hidden; color: #647080; text-align: right; user-select: none; background: transparent; }
#bf-triangle-practice .bftp-note, #bf-triangle-practice .bftp-analysis-note { margin: 10px 0; font-size: 12px; line-height: 1.8; color: #59616d; }
#bf-triangle-practice .bftp-note code { font: 12px Consolas, monospace; color: inherit; padding: 0; background: none; }
#bf-triangle-practice .bftp-consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 13px; line-height: 1.8; }
#bf-triangle-practice .bftp-consent input { flex: 0 0 auto; margin: 5px 0 0; width: 16px; height: 16px; accent-color: #20242b; }
#bf-triangle-practice .bftp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
#bf-triangle-practice .bftp-actions button { border: 1px solid #20242b; border-radius: 0; box-shadow: none; background: #20242b; color: #fff; min-height: 44px; padding: 10px 18px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
#bf-triangle-practice .bftp-actions .bftp-compare { background: #fff; color: #20242b; }
#bf-triangle-practice .bftp-actions button:disabled { opacity: .6; cursor: wait; }
#bf-triangle-practice :focus-visible { outline: 2px solid #315b8c; outline-offset: 3px; }
#bf-triangle-practice .bftp-code:focus-visible { outline-offset: -2px; }
#bf-triangle-practice .bftp-status { font-size: 13px; line-height: 1.8; margin: 12px 0 0; }
#bf-triangle-practice .bftp-status:empty { display: none; }
#bf-triangle-practice .bftp-result { margin-top: 24px; padding: 20px; border: 1px solid #c6cbd2; background: #fafbfc; }
#bf-triangle-practice .bftp-answer { white-space: normal; overflow-wrap: anywhere; font-size: 14px; line-height: 1.9; }
#bf-triangle-practice .bftp-answer h4 { margin: 20px 0 8px; font-size: 15px; font-weight: 700; line-height: 1.6; }
#bf-triangle-practice .bftp-answer > h4:first-child { margin-top: 0; }
#bf-triangle-practice .bftp-answer :not(pre) > code { font: 13px/1.7 Consolas, 'Courier New', monospace; }
#bf-triangle-practice .bftp-answer :is(p, ul, ol) { margin: 0 0 12px; }
#bf-triangle-practice .bftp-answer :is(ul, ol) { padding-left: 24px; }
#bf-triangle-practice .bftp-answer li { margin: 0 0 4px; }
#bf-triangle-practice .bftp-answer > :last-child { margin-bottom: 0; }
#bf-triangle-practice .bftp-answer pre { margin: 16px 0; padding: 16px; border: 1px solid #c6cbd2; border-radius: 0; box-shadow: none; background: #f6f7f9; overflow: auto; white-space: pre; }
#bf-triangle-practice .bftp-answer pre code { margin: 0; padding: 0; background: none; color: #20242b; font: 14px/24px Consolas, 'Courier New', monospace; text-shadow: none; }
#bf-triangle-practice .token, .single .entry-content .bf-algorithm-article .bftp-solution-panel .token { color: inherit; background: none; }
#bf-triangle-practice .token.comment, #bf-triangle-practice .token.prolog, .single .entry-content .bf-algorithm-article .bftp-solution-panel .token.comment, .single .entry-content .bf-algorithm-article .bftp-solution-panel .token.prolog { color: #59616d; }
#bf-triangle-practice .token.keyword, #bf-triangle-practice .token.boolean, .single .entry-content .bf-algorithm-article .bftp-solution-panel .token.keyword, .single .entry-content .bf-algorithm-article .bftp-solution-panel .token.boolean { color: #643f9c; }
#bf-triangle-practice .token.string, .single .entry-content .bf-algorithm-article .bftp-solution-panel .token.string { color: #286447; }
#bf-triangle-practice .token.number, #bf-triangle-practice .token.function, .single .entry-content .bf-algorithm-article .bftp-solution-panel .token.number, .single .entry-content .bf-algorithm-article .bftp-solution-panel .token.function { color: #275f91; }
#bf-triangle-practice .token.operator, #bf-triangle-practice .token.punctuation, .single .entry-content .bf-algorithm-article .bftp-solution-panel .token.operator, .single .entry-content .bf-algorithm-article .bftp-solution-panel .token.punctuation { color: #353e49; background: none; }
@media (max-width: 480px) {
  .bf-algorithm-article .bftp-solutions { padding: 16px; }
  #bf-triangle-practice .bftp-actions { display: grid; grid-template-columns: 1fr 1fr; }
  #bf-triangle-practice .bftp-actions button { padding: 10px 8px; font-size: 13px; }
  #bf-triangle-practice .bftp-gutter { width: 32px; padding-right: 4px; }
  #bf-triangle-practice .bftp-code, #bf-triangle-practice .bftp-highlight { padding: 16px 10px; }
  #bf-triangle-practice .bftp-result { padding: 16px; }
}
@media (forced-colors: active) {
  #bf-triangle-practice .bftp-caret { background: CanvasText; }
  #bf-triangle-practice.bftp-highlight-ready .bftp-code { color: CanvasText; -webkit-text-fill-color: CanvasText; background: Canvas; }
  #bf-triangle-practice .bftp-highlight { visibility: hidden; }
}
