/* TestKav Skills — programming code blocks and code composer. */
.tk-code-shell,
pre.tk-code-block {
  --tk-code-bg: #0b1220;
  --tk-code-bar: #111a2b;
  --tk-code-line: rgba(148, 163, 184, .18);
  --tk-code-text: #e5edf7;
  --tk-code-muted: #9fb0c5;
  --tk-code-soft: rgba(255, 255, 255, .055);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.tk-code-shell {
  position: relative;
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--tk-code-line);
  border-radius: 14px;
  background: var(--tk-code-bg);
  box-shadow: 0 14px 36px -28px rgba(2, 6, 23, .85);
}

.tk-code-toolbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 11px 0 14px;
  background: var(--tk-code-bar);
  border-bottom: 1px solid var(--tk-code-line);
  color: var(--tk-code-muted);
  font: 600 11.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  direction: ltr !important;
  text-align: left !important;
}

.tk-code-language {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  letter-spacing: .02em;
}

.tk-code-language::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #f6bf26;
  box-shadow: 0 0 0 3px rgba(246, 191, 38, .12);
}

.tk-code-copy {
  min-height: 27px;
  padding: 4px 10px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 8px;
  background: var(--tk-code-soft);
  color: var(--tk-code-text);
  font: inherit;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.tk-code-copy:hover,
.tk-code-copy:focus-visible {
  outline: none;
  border-color: rgba(246, 191, 38, .6);
  background: rgba(246, 191, 38, .09);
  color: #fff;
}

.tk-code-copy.is-done { color: #86efac; border-color: rgba(134, 239, 172, .45); }

pre.tk-code-block {
  position: relative;
  display: block;
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate;
  margin: 14px 0;
  padding: 42px 18px 18px;
  overflow: auto;
  border: 1px solid var(--tk-code-line);
  border-radius: 14px;
  background: var(--tk-code-bg);
  color: var(--tk-code-text);
  white-space: pre;
  tab-size: 4;
  -moz-tab-size: 4;
  font: 500 13.5px/1.75 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
  letter-spacing: 0;
  word-break: normal;
  overflow-wrap: normal;
  text-transform: none;
  text-shadow: none;
  hyphens: none;
  -webkit-font-smoothing: antialiased;
}

.tk-code-shell > pre.tk-code-block {
  margin: 0;
  padding-top: 17px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

pre.tk-code-block::before {
  content: attr(data-language);
  position: absolute;
  top: 10px;
  left: 14px;
  color: var(--tk-code-muted);
  font: 700 10.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: .06em;
  pointer-events: none;
}

.tk-code-shell > pre.tk-code-block::before { display: none; }

pre.tk-code-block > code,
.tk-code-shell pre.tk-code-block > code {
  display: block;
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate;
  min-width: max-content;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent !important;
  color: inherit;
  white-space: inherit;
  font: inherit !important;
  line-height: inherit;
  text-shadow: none;
}

/* Prism token palette tuned for Persian/English question surfaces.
   The editor has several inherited color rules, so token colors are explicit
   and important. This keeps syntax colors visible in design, preview, exam,
   practice, review, correction and free-test surfaces alike. */
pre.tk-code-block > code .token { background: transparent !important; text-shadow: none !important; }
pre.tk-code-block > code .token.comment,
pre.tk-code-block > code .token.prolog,
pre.tk-code-block > code .token.doctype,
pre.tk-code-block > code .token.cdata { color: #718096 !important; font-style: italic; }
pre.tk-code-block > code .token.punctuation { color: #a8b6c9 !important; }
pre.tk-code-block > code .token.namespace { opacity: .82; }
pre.tk-code-block > code .token.property,
pre.tk-code-block > code .token.tag,
pre.tk-code-block > code .token.boolean,
pre.tk-code-block > code .token.number,
pre.tk-code-block > code .token.constant,
pre.tk-code-block > code .token.symbol,
pre.tk-code-block > code .token.deleted { color: #f78c8c !important; }
pre.tk-code-block > code .token.selector,
pre.tk-code-block > code .token.attr-name,
pre.tk-code-block > code .token.string,
pre.tk-code-block > code .token.char,
pre.tk-code-block > code .token.builtin,
pre.tk-code-block > code .token.inserted { color: #9fe6a0 !important; }
pre.tk-code-block > code .token.operator,
pre.tk-code-block > code .token.entity,
pre.tk-code-block > code .token.url,
pre.tk-code-block > code.language-css .token.string,
pre.tk-code-block > code.style .token.string { color: #d4d9e2 !important; }
pre.tk-code-block > code .token.atrule,
pre.tk-code-block > code .token.attr-value,
pre.tk-code-block > code .token.keyword { color: #c8a7ff !important; }
pre.tk-code-block > code .token.function,
pre.tk-code-block > code .token.class-name { color: #ffd56a !important; }
pre.tk-code-block > code .token.regex,
pre.tk-code-block > code .token.important,
pre.tk-code-block > code .token.variable { color: #ffb86b !important; }
pre.tk-code-block > code .token.parameter { color: #dbeafe !important; }
pre.tk-code-block > code .token.decorator,
pre.tk-code-block > code .token.annotation { color: #69d2e7 !important; }
pre.tk-code-block > code .token.important,
pre.tk-code-block > code .token.bold { font-weight: 800; }
pre.tk-code-block > code .token.italic { font-style: italic; }
pre.tk-code-block > code .token.entity { cursor: help; }

/* A high-contrast palette is selected automatically for light custom colors. */
pre.tk-code-block[data-code-tone="light"] > code .token.comment,
pre.tk-code-block[data-code-tone="light"] > code .token.prolog,
pre.tk-code-block[data-code-tone="light"] > code .token.doctype,
pre.tk-code-block[data-code-tone="light"] > code .token.cdata { color: #64748b !important; }
pre.tk-code-block[data-code-tone="light"] > code .token.punctuation { color: #475569 !important; }
pre.tk-code-block[data-code-tone="light"] > code .token.property,
pre.tk-code-block[data-code-tone="light"] > code .token.tag,
pre.tk-code-block[data-code-tone="light"] > code .token.boolean,
pre.tk-code-block[data-code-tone="light"] > code .token.number,
pre.tk-code-block[data-code-tone="light"] > code .token.constant,
pre.tk-code-block[data-code-tone="light"] > code .token.symbol,
pre.tk-code-block[data-code-tone="light"] > code .token.deleted { color: #b42318 !important; }
pre.tk-code-block[data-code-tone="light"] > code .token.selector,
pre.tk-code-block[data-code-tone="light"] > code .token.attr-name,
pre.tk-code-block[data-code-tone="light"] > code .token.string,
pre.tk-code-block[data-code-tone="light"] > code .token.char,
pre.tk-code-block[data-code-tone="light"] > code .token.builtin,
pre.tk-code-block[data-code-tone="light"] > code .token.inserted { color: #166534 !important; }
pre.tk-code-block[data-code-tone="light"] > code .token.operator,
pre.tk-code-block[data-code-tone="light"] > code .token.entity,
pre.tk-code-block[data-code-tone="light"] > code .token.url,
pre.tk-code-block[data-code-tone="light"] > code.language-css .token.string,
pre.tk-code-block[data-code-tone="light"] > code.style .token.string { color: #334155 !important; }
pre.tk-code-block[data-code-tone="light"] > code .token.atrule,
pre.tk-code-block[data-code-tone="light"] > code .token.attr-value,
pre.tk-code-block[data-code-tone="light"] > code .token.keyword { color: #6d28d9 !important; }
pre.tk-code-block[data-code-tone="light"] > code .token.function,
pre.tk-code-block[data-code-tone="light"] > code .token.class-name { color: #854d0e !important; }
pre.tk-code-block[data-code-tone="light"] > code .token.regex,
pre.tk-code-block[data-code-tone="light"] > code .token.important,
pre.tk-code-block[data-code-tone="light"] > code .token.variable { color: #c2410c !important; }
pre.tk-code-block[data-code-tone="light"] > code .token.parameter { color: #1e3a5f !important; }
pre.tk-code-block[data-code-tone="light"] > code .token.decorator,
pre.tk-code-block[data-code-tone="light"] > code .token.annotation { color: #0369a1 !important; }
.tk-code-shell[data-code-tone="light"] .tk-code-copy:hover,
.tk-code-shell[data-code-tone="light"] .tk-code-copy:focus-visible { color: #172033; }

/* Code blocks must stay LTR even inside RTL questions and options. */
[dir="rtl"] .tk-code-shell,
[dir="rtl"] pre.tk-code-block,
.question-body .tk-code-shell,
.option-item .tk-code-shell,
.practice-question-card .tk-code-shell,
.rvq-card .tk-code-shell,
.ft-question .tk-code-shell {
  direction: ltr !important;
  text-align: left !important;
}

/* Editor behavior: code itself is edited through the safe popup. */
[contenteditable="true"] pre.tk-code-block,
.skqd-rt__area pre.tk-code-block {
  cursor: pointer;
  user-select: text;
  margin-block: 10px;
}

[contenteditable="true"] pre.tk-code-block::after,
.skqd-rt__area pre.tk-code-block::after {
  content: "دوبار کلیک برای ویرایش";
  position: absolute;
  top: 9px;
  right: 12px;
  padding: 2px 7px;
  border-radius: 7px;
  background: var(--tk-code-soft);
  color: var(--tk-code-muted);
  font: 600 9.5px/1.5 var(--sk-font, sans-serif);
  direction: rtl;
  opacity: .76;
  pointer-events: none;
}

[contenteditable="true"] pre.tk-code-block.is-selected,
.skqd-rt__area pre.tk-code-block.is-selected {
  outline: 2px solid #f6bf26;
  outline-offset: 2px;
}

.skqd-rtb.tk-code-trigger {
  width: auto !important;
  min-width: 0;
  height: 30px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-inline-start: 3px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  box-shadow: none;
  white-space: nowrap;
  direction: rtl;
  transition: background .13s ease, color .13s ease;
}
.skqd-rtb.tk-code-trigger:hover,
.skqd-rtb.tk-code-trigger:focus-visible {
  outline: none;
  transform: none;
  background: var(--sk-surface);
  color: var(--sk-ink);
  box-shadow: none;
}
.skqd-rtb.tk-code-trigger:active { transform: none; }
.skqd-rtb.tk-code-trigger .tk-code-trigger__icon {
  width: auto;
  height: auto;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: none;
  color: inherit;
  box-shadow: none;
}
.skqd-rtb.tk-code-trigger svg { width: 16px; height: 16px; }
.skqd-rtb.tk-code-trigger .tk-code-trigger__label { font-size: 11px; font-weight: 750; line-height: 1; }

.skb-richbtn.tk-code-legacy-btn,
.tk-code-legacy-tools .tk-code-legacy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 8px 5px 12px;
  border: 1px solid rgba(219, 167, 10, .48);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(246, 191, 38, .18), rgba(246, 191, 38, .06));
  color: #765600;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.skb-richbtn.tk-code-legacy-btn:hover,
.skb-richbtn.tk-code-legacy-btn:focus-visible,
.tk-code-legacy-tools .tk-code-legacy-btn:hover,
.tk-code-legacy-tools .tk-code-legacy-btn:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: #dba70a;
  background: linear-gradient(135deg, rgba(246, 191, 38, .30), rgba(246, 191, 38, .11));
  box-shadow: 0 9px 22px -17px rgba(117, 86, 0, .9);
}
.tk-code-legacy-btn__icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f6bf26;
  color: #2f2404;
}
.skb-richbtn.tk-code-legacy-btn svg,
.tk-code-legacy-btn svg { width: 16px; height: 16px; }
.tk-code-legacy-tools { display: flex; align-items: center; gap: 7px; margin: 0 0 7px; }

/* Composer popup */
body.tk-code-modal-open { overflow: hidden !important; }
.tk-code-modal[hidden] { display: none !important; }
.tk-code-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 18px;
  font-family: var(--sk-font, "Pinar", Tahoma, sans-serif);
}
.tk-code-modal__backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, .72); backdrop-filter: blur(5px); }
.tk-code-modal__dialog {
  position: relative;
  width: min(920px, 96vw);
  max-height: min(860px, 94vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 20px;
  background: var(--sk-surface, #fff);
  color: var(--sk-ink, #172033);
  box-shadow: 0 30px 100px rgba(2, 6, 23, .38);
}
.tk-code-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid var(--sk-line, #e5e7eb);
}
.tk-code-modal__head h2 { margin: 0; font-size: 18px; line-height: 1.5; }
.tk-code-modal__head p { margin: 4px 0 0; color: var(--sk-ink-soft, #697386); font-size: 12.5px; line-height: 1.8; }
.tk-code-modal__x {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--sk-line, #e5e7eb);
  border-radius: 11px;
  background: transparent;
  color: inherit;
  font-size: 24px;
  cursor: pointer;
}
.tk-code-modal__body { min-height: 0; overflow: auto; padding: 17px 20px 20px; }
.tk-code-modal__controls { display: flex; align-items: end; gap: 12px; margin-bottom: 12px; }
.tk-code-modal__controls label { flex: 1; display: grid; gap: 6px; font-size: 12px; font-weight: 800; }
.tk-code-modal__controls select {
  width: 100%; min-height: 42px; padding: 7px 11px;
  border: 1px solid var(--sk-line, #dfe3e8); border-radius: 11px;
  background: var(--sk-surface, #fff); color: inherit; font: inherit;
}
.tk-code-detected {
  min-width: 210px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid rgba(246, 191, 38, .34);
  border-radius: 11px;
  background: rgba(246, 191, 38, .08);
  font-size: 11.5px;
}
.tk-code-detected span { color: var(--sk-ink-soft, #697386); }
.tk-code-detected strong { color: var(--sk-ink, #172033); }
.tk-code-detected small { color: #8a6500; font-weight: 800; }

.tk-code-color-panel {
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--sk-line, #dfe3e8);
  border-radius: 14px;
  background: rgba(246, 191, 38, .035);
  background: color-mix(in srgb, var(--sk-surface, #fff) 94%, #f6bf26 6%);
}
.tk-code-color-panel__head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--sk-line, #dfe3e8);
}
.tk-code-color-panel__head > div { display: grid; gap: 2px; }
.tk-code-color-panel__head strong { font-size: 12px; line-height: 1.5; }
.tk-code-color-panel__head small { color: var(--sk-ink-faint, #8791a2); font-size: 10.5px; line-height: 1.6; }
.tk-code-color-reset {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--sk-line, #dfe3e8);
  border-radius: 9px;
  background: var(--sk-surface, #fff);
  color: var(--sk-ink-soft, #697386);
  font: inherit;
  font-size: 10.5px;
  font-weight: 750;
  cursor: pointer;
}
.tk-code-color-reset:hover,
.tk-code-color-reset:focus-visible { outline: none; border-color: rgba(219, 167, 10, .65); color: #765600; }
.tk-code-color-panel__body { padding: 11px 12px 12px; }
.tk-code-color-presets {
  display: grid;
  grid-template-columns: repeat(7, minmax(70px, 1fr));
  gap: 8px;
}
.tk-code-color-swatch {
  position: relative;
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-rows: 28px auto;
  justify-items: center;
  align-items: center;
  gap: 4px;
  padding: 6px 5px 5px;
  border: 1px solid var(--sk-line, #dfe3e8);
  border-radius: 11px;
  background: var(--sk-surface, #fff);
  color: var(--sk-ink-soft, #697386);
  font: inherit;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.tk-code-color-swatch:hover,
.tk-code-color-swatch:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(219, 167, 10, .55);
}
.tk-code-color-swatch.is-selected {
  border-color: #dba70a;
  background: rgba(246, 191, 38, .10);
  box-shadow: 0 0 0 2px rgba(246, 191, 38, .13);
}
.tk-code-color-swatch__paint {
  width: 100%;
  height: 28px;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.tk-code-color-swatch__label {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 9.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tk-code-color-swatch__check {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f6bf26;
  color: #2f2404;
  font-size: 10px;
  font-weight: 900;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .16s ease, transform .16s ease;
}
.tk-code-color-swatch.is-selected .tk-code-color-swatch__check { opacity: 1; transform: scale(1); }
.tk-code-color-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--sk-line, #dfe3e8);
}
.tk-code-color-picker {
  position: relative;
  min-width: 190px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border: 1px solid var(--sk-line, #dfe3e8);
  border-radius: 11px;
  background: var(--sk-surface, #fff);
  cursor: pointer;
}
.tk-code-color-picker input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.tk-code-color-picker__swatch {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 2px solid var(--sk-surface, #fff);
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .17), 0 4px 12px -8px rgba(2, 6, 23, .7);
}
.tk-code-color-picker > span:last-child { display: grid; gap: 1px; }
.tk-code-color-picker strong { font-size: 10.8px; line-height: 1.4; }
.tk-code-color-picker small { color: var(--sk-ink-faint, #8791a2); font-size: 9.5px; line-height: 1.4; }
.tk-code-color-hex {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sk-ink-soft, #697386);
  font-size: 10.5px;
  font-weight: 750;
}
.tk-code-color-hex input {
  width: 118px;
  min-height: 39px;
  padding: 7px 10px;
  border: 1px solid var(--sk-line, #dfe3e8);
  border-radius: 10px;
  outline: none;
  background: var(--sk-surface, #fff);
  color: var(--sk-ink, #172033);
  text-align: center;
  text-transform: uppercase;
  font: 700 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.tk-code-color-hex input:focus { border-color: #dba70a; box-shadow: 0 0 0 3px rgba(246, 191, 38, .12); }
.tk-code-color-hex input.is-invalid { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .10); }
.tk-code-modal__input { display: grid; gap: 7px; font-size: 12px; font-weight: 800; }
.tk-code-modal__input textarea {
  width: 100%; min-height: 245px; resize: vertical; box-sizing: border-box;
  padding: 14px 15px; border: 1px solid var(--tk-code-line, #27344a); border-radius: 13px;
  outline: none; background: var(--tk-code-bg, #0b1220); color: var(--tk-code-text, #e5edf7);
  direction: ltr !important; text-align: left !important; unicode-bidi: isolate;
  font: 500 13.5px/1.75 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  tab-size: 4;
}
.tk-code-modal__input textarea:focus { border-color: #f6bf26; box-shadow: 0 0 0 3px rgba(246, 191, 38, .13); }
.tk-code-modal__input textarea::placeholder { color: var(--tk-code-muted, #8791a2); }
.tk-code-modal__input textarea.is-invalid { border-color: #ef4444; animation: tkCodeShake .24s linear; }
@keyframes tkCodeShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.tk-code-modal__meta { display: flex; justify-content: space-between; gap: 12px; margin: 7px 2px 13px; color: var(--sk-ink-faint, #8791a2); font-size: 10.5px; }
.tk-code-modal__preview-title { margin-bottom: 7px; font-size: 12px; font-weight: 800; }
.tk-code-modal-preview { min-height: 90px; direction: ltr !important; }
.tk-code-modal-preview pre.tk-code-block { margin: 0; max-height: 280px; }
.tk-code-modal__empty { display: grid; place-items: center; min-height: 90px; border: 1px dashed var(--sk-line, #dfe3e8); border-radius: 13px; color: var(--sk-ink-faint, #8791a2); font-size: 12px; }
.tk-code-modal__foot { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 13px 20px; border-top: 1px solid var(--sk-line, #e5e7eb); }
.tk-code-modal__cancel,
.tk-code-modal__insert { min-height: 40px; padding: 8px 16px; border-radius: 11px; font: inherit; font-weight: 800; cursor: pointer; }
.tk-code-modal__cancel { border: 1px solid var(--sk-line, #dfe3e8); background: transparent; color: inherit; }
.tk-code-modal__insert { border: 1px solid #dba70a; background: #f6bf26; color: #241b02; }

[data-theme="dark"] .tk-code-modal__dialog { --sk-surface: #151b26; --sk-ink: #eef2f7; --sk-ink-soft: #a8b2c1; --sk-ink-faint: #8791a2; --sk-line: #2b3443; }
[data-theme="dark"] .tk-code-modal__controls select { background: #101620; }
[data-theme="dark"] .skb-richbtn.tk-code-legacy-btn,
[data-theme="dark"] .tk-code-legacy-tools .tk-code-legacy-btn {
  background: linear-gradient(135deg, rgba(246, 191, 38, .17), rgba(246, 191, 38, .055));
  color: #f4d06f;
}


@media (max-width: 720px) {
  .tk-code-modal { padding: 8px; }
  .tk-code-modal__dialog { width: 100%; max-height: 96vh; border-radius: 15px; }
  .tk-code-modal__head { padding: 14px; }
  .tk-code-modal__body { padding: 14px; }
  .tk-code-modal__controls { align-items: stretch; flex-direction: column; }
  .tk-code-detected { min-width: 0; justify-content: flex-start; }
  .tk-code-color-panel__head { align-items: flex-start; }
  .tk-code-color-presets { grid-template-columns: repeat(4, minmax(62px, 1fr)); }
  .tk-code-color-custom { align-items: stretch; flex-direction: column; }
  .tk-code-color-picker { min-width: 0; }
  .tk-code-color-hex { justify-content: space-between; }
  .tk-code-modal__input textarea { min-height: 210px; }
  .tk-code-modal__meta { flex-direction: column; }
  .tk-code-modal__foot { padding: 11px 14px; }
  pre.tk-code-block { font-size: 12.5px !important; padding-inline: 13px; }
  .tk-code-toolbar { padding-inline: 10px; }
  .skqd-rtb.tk-code-trigger { min-width: 34px; width: 34px !important; padding: 3px; }
  .skqd-rtb.tk-code-trigger .tk-code-trigger__label { display: none; }
}

@media (max-width: 430px) {
  .tk-code-color-panel__head { flex-direction: column; }
  .tk-code-color-reset { width: 100%; }
  .tk-code-color-presets { grid-template-columns: repeat(2, minmax(90px, 1fr)); }
}

@media print {
  .tk-code-shell,
  pre.tk-code-block {
    break-inside: avoid;
    page-break-inside: avoid;
    border-color: #a8a8a8 !important;
    background: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
  }
  .tk-code-toolbar { display: none !important; }
  .tk-code-shell > pre.tk-code-block { padding-top: 14px; }
  pre.tk-code-block::before { color: #555; }
  .tk-code-block .token.comment,
  .tk-code-block .token.prolog,
  .tk-code-block .token.doctype,
  .tk-code-block .token.cdata { color: #555 !important; }
  .tk-code-block .token.keyword,
  .tk-code-block .token.atrule,
  .tk-code-block .token.attr-value { color: #5b21b6 !important; }
  .tk-code-block .token.string,
  .tk-code-block .token.char,
  .tk-code-block .token.selector,
  .tk-code-block .token.attr-name { color: #166534 !important; }
  .tk-code-block .token.number,
  .tk-code-block .token.boolean,
  .tk-code-block .token.constant { color: #b42318 !important; }
  .tk-code-block .token.function,
  .tk-code-block .token.class-name { color: #854d0e !important; }
}
