:root {
  --md-primary-fg-color: #6b3d2e;
  --md-accent-fg-color: #b3471b;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  letter-spacing: -0.02em;
}

.md-typeset .admonition.danger,
.md-typeset details.danger {
  border-color: #8d2a20;
}

.md-typeset .admonition.danger > .admonition-title,
.md-typeset details.danger > summary {
  background-color: rgba(141, 42, 32, 0.1);
}

.md-typeset img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.9rem;
}

.md-typeset .instruction-img {
    border-radius: 0;
    margin-left: 3%;
    border: 0;
    
}
.md-typeset .pipeline-img {
  border-radius: 0;
  margin: 0;
  border: 0;
}

.md-typeset .cfg {
    border-radius:0;
    margin-left: 15%;
    border: 0;
    width: 55%;
}

/* --- Quiz widget --- */
.quiz-question {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--md-code-bg-color);
  border-radius: 0.4rem;
}

.quiz-question p {
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.quiz-question label {
  display: block;
  padding: 0.25rem 0;
  cursor: pointer;
}

.quiz-question input[type="radio"] {
  margin-right: 0.5rem;
}

.quiz-submit {
  margin-top: 1rem;
  padding: 0.5rem 1.5rem;
  background: var(--md-primary-fg-color);
  color: white;
  border: none;
  border-radius: 0.3rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.quiz-submit:hover {
  opacity: 0.9;
}

.quiz-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quiz-score {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.quiz-result-item {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 0.3rem;
  border-left: 4px solid;
}

.quiz-correct {
  background: rgba(46, 125, 50, 0.08);
  border-left-color: #2e7d32;
}

.quiz-incorrect {
  background: rgba(198, 40, 40, 0.08);
  border-left-color: #c62828;
}

.quiz-error {
  color: #c62828;
  padding: 0.5rem;
}

/* ============================================================
   Inline term tooltips (.tip-hc)
   Emitted by hooks/glossary_tooltips.py from the [[term]] shorthand.
   Opens on hover / keyboard focus; pins open on click (tooltips.js).
   ============================================================ */
.md-typeset .tip-hc {
  position: relative;
  border-bottom: 1px dotted var(--md-accent-fg-color);
  cursor: help;
  text-decoration: none;
}

.md-typeset .tip-body {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: max-content;
  max-width: 18rem;
  padding: 0.5rem 0.7rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.3rem;
  box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.25);
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.5;
  cursor: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

/* little arrow under the popover */
.md-typeset .tip-body::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 0.35rem solid transparent;
  border-top-color: var(--md-default-fg-color--lightest);
}

.md-typeset .tip-body a {
  white-space: nowrap;
}

/* Reveal on hover, keyboard focus, or when pinned open via click. */
.md-typeset .tip-hc:hover .tip-body,
.md-typeset .tip-hc:focus-within .tip-body,
.md-typeset .tip-hc.is-open .tip-body {
  opacity: 1;
  visibility: visible;
}

/* --- Reader feedback --- */
/* Card closing a chapter: onward link on top, rating along the bottom. The
   :not(:empty) guard keeps it from drawing an empty box when JS is off and
   the page has no next chapter. */
.feedback-block:not(:empty) {
  margin: 3rem 0 1rem;
  overflow: hidden;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.4rem;
}

.feedback-next {
  display: block;
  padding: 0.9rem 1.1rem;
  text-decoration: none;
}

.feedback-next:hover {
  background: var(--md-default-fg-color--lightest);
}

.feedback-next-kicker {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}

.feedback-next-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--md-accent-fg-color);
}

.feedback-next-title::after {
  content: " →";
}

/* The rating row. Also the container for the comment form that replaces the
   buttons once a rating is in, hence the block layout when it holds a form. */
.feedback-rate:not(:empty) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.6rem 1.1rem;
  background: var(--md-default-fg-color--lightest);
}

.feedback-next + .feedback-rate:not(:empty) {
  border-top: 1px solid var(--md-default-fg-color--lightest);
}

.feedback-rate:has(.feedback-form) {
  display: block;
}

.feedback-prompt {
  margin: 0;
  font-size: 0.7rem;
  color: var(--md-default-fg-color--light);
}

.feedback-rate:has(.feedback-form) .feedback-prompt {
  margin-bottom: 0.5rem;
}

.feedback-thumbs {
  display: flex;
  gap: 0.4rem;
}

.feedback-thumb {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  font: inherit;
  font-size: 0.68rem;
  color: var(--md-default-fg-color--light);
  cursor: pointer;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 2rem;
  transition: color 0.1s ease, border-color 0.1s ease;
}

.feedback-thumb-icon {
  width: 0.85rem;
  height: 0.85rem;
  fill: currentColor;
}

.feedback-thumb--down .feedback-thumb-icon {
  transform: rotate(180deg);
}

.feedback-thumb:hover:not(:disabled) {
  color: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
}

.feedback-thumb:disabled {
  opacity: 0.5;
  cursor: default;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Honeypot. Moved out of view rather than `display: none`, which the cruder
   bots know to skip; aria-hidden and tabindex="-1" keep it away from screen
   readers and the keyboard, so only a form-filling bot ever reaches it. */
.feedback-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.feedback-textarea,
.feedback-email {
  width: 100%;
  padding: 0.5rem;
  font: inherit;
  font-size: 0.75rem;
  color: var(--md-default-fg-color);
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 0.35rem;
  resize: vertical;
}

.feedback-textarea:focus,
.feedback-email:focus {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 1px;
}

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.feedback-send {
  padding: 0.4rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--md-primary-bg-color);
  cursor: pointer;
  background: var(--md-accent-fg-color);
  border: none;
  border-radius: 0.35rem;
}

.feedback-send:disabled {
  opacity: 0.6;
  cursor: default;
}

.feedback-status,
.feedback-thanks {
  margin: 0;
  font-size: 0.7rem;
  color: var(--md-default-fg-color--light);
}

/* Floating button — offset so it never sits under Material's back-to-top. */
.feedback-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 5;
  padding: 0.5rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--md-primary-bg-color);
  cursor: pointer;
  background: var(--md-primary-fg-color);
  border: none;
  border-radius: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.feedback-fab:hover {
  background: var(--md-accent-fg-color);
}

.feedback-popover {
  position: fixed;
  right: 1rem;
  bottom: 4rem;
  z-index: 10;
  width: min(22rem, calc(100vw - 2rem));
  padding: 0.9rem;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.feedback-popover--anchored {
  position: absolute;
  right: auto;
  bottom: auto;
}

.feedback-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-size: 0.75rem;
}

.feedback-close {
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--md-default-fg-color--light);
  background: none;
  border: none;
}

.feedback-quote {
  margin: 0 0 0.5rem;
  padding-left: 0.6rem;
  font-size: 0.7rem;
  font-style: italic;
  color: var(--md-default-fg-color--light);
  border-left: 2px solid var(--md-accent-fg-color);
}

.feedback-bubble {
  position: absolute;
  z-index: 8;
  padding: 0.3rem 0.7rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--md-primary-bg-color);
  cursor: pointer;
  background: var(--md-primary-fg-color);
  border: none;
  border-radius: 0.3rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@media print {
  .feedback-fab,
  .feedback-popover,
  .feedback-bubble,
  .feedback-block { display: none; }
}