/* Builder package file — replaced on every Update package. Change behaviour in functions/ops-hooks.ts (functions/mlm-ops/api.ts). */
/**
 * mlm-ops · Key takeaways and contents. Inherits the page's font and colours; every tone and dimension is a custom
 * property the site can set on the band or any ancestor, each defaulting to the site's own where it names one:
 *
 *   --kt-accent        the open heading, numbers and links      --brand-accent, --accent, else currentColor
 *   --kt-surface       the band's background                   --brand-surface, --surface, else Canvas
 *   --kt-edge          the band's border                        currentColor at 15%
 *   --kt-muted         closed headings                          currentColor at 75%
 *   --kt-radius        corner radius                            --brand-radius, --radius, else 3px
 *   --kt-pad           padding inside the band                  14px 18px
 *   --kt-gap           space between headings and columns       18px
 *   --kt-shadow        the open band's shadow                   a soft one in the text colour
 *   --kt-layer         the open band's stacking order           20
 *
 * Nothing here reaches outside `.mlm-kt`.
 */
.mlm-kt {
  --kt-accent: var(--brand-accent, var(--accent, currentColor));
  --kt-surface: var(--brand-surface, var(--surface, Canvas));
  --kt-edge: color-mix(in srgb, currentColor 15%, transparent);
  --kt-muted: color-mix(in srgb, currentColor 75%, transparent);
  --kt-radius: var(--brand-radius, var(--radius, 3px));
  --kt-pad: 14px 18px;
  --kt-gap: 18px;
  --kt-shadow: 0 12px 32px color-mix(in srgb, currentColor 14%, transparent);
  --kt-layer: 20;
  display: block;
  margin: 0;
  position: relative;
}
.mlm-kt-frame { position: relative; }
.mlm-kt-band {
  display: flex;
  align-items: center;
  gap: var(--kt-gap);
  padding: var(--kt-pad);
  border: 1px solid var(--kt-edge);
  border-radius: var(--kt-radius);
  background: var(--kt-surface);
  max-height: 2lh;
  overflow: hidden;
  transition: box-shadow 0.22s ease, max-height 0.26s ease;
}
.mlm-kt-text { display: none; }
.mlm-kt-heads {
  display: flex;
  flex: 1 1 auto;
  gap: var(--kt-gap);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.mlm-kt-head,
.mlm-kt-toc-toggle {
  font: inherit;
  color: var(--kt-muted);
  background: none;
  border: 0;
  padding: 2px 0;
  cursor: pointer;
  border-radius: 2px;
  text-align: start;
}
.mlm-kt-head:hover,
.mlm-kt-toc-toggle:hover,
.mlm-kt-head.is-open { color: inherit; }
.mlm-kt-head.is-open { font-weight: 600; box-shadow: inset 3px 0 0 var(--kt-accent); padding-inline-start: 10px; }
.mlm-kt-head:focus-visible,
.mlm-kt-toc-toggle:focus-visible,
.mlm-kt-nav a:focus-visible { outline: 2px solid var(--kt-accent); outline-offset: 2px; }
.mlm-kt-num { color: var(--kt-accent); font-variant-numeric: tabular-nums; }
.mlm-kt-toc { flex: 0 0 auto; border-inline-start: 1px solid var(--kt-edge); padding-inline-start: var(--kt-gap); }
.mlm-kt-caret { display: inline-block; margin-inline-start: 6px; transition: transform 0.22s ease; }
.mlm-kt-nav ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.mlm-kt-nav a { color: var(--kt-accent); text-decoration: none; }
.mlm-kt-nav a:hover { text-decoration: underline; }
.mlm-kt-panel-heading { margin: 0 0 8px; font-weight: 600; }
.mlm-kt-panel-text { margin: 0; line-height: 1.55; }

/* Open: the band lies over what follows, inside the frame that keeps the closed band's height. */
.mlm-kt:not([data-state='closed']) .mlm-kt-band {
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: var(--kt-layer);
  max-height: 80vh;
  overflow: auto;
  box-shadow: var(--kt-shadow);
}
.mlm-kt[data-state='open'] .mlm-kt-band {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.mlm-kt[data-state='open'] .mlm-kt-text { display: block; }
.mlm-kt[data-state='open'] .mlm-kt-heads { flex-direction: column; white-space: normal; overflow: visible; gap: 8px; }
.mlm-kt:not([data-state='closed']) .mlm-kt-caret { transform: rotate(180deg); }
.mlm-kt[data-state='contents'] .mlm-kt-band { flex-wrap: wrap; }
.mlm-kt[data-state='contents'] .mlm-kt-nav { flex: 1 0 100%; padding-top: 10px; }
.mlm-kt[data-state='contents'] .mlm-kt-toc { display: flex; flex-direction: column; align-items: flex-start; }

@media (max-width: 720px) {
  .mlm-kt[data-state='open'] .mlm-kt-band { grid-template-columns: minmax(0, 1fr); }
  .mlm-kt[data-state='open'] .mlm-kt-toc { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid var(--kt-edge); padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .mlm-kt-band, .mlm-kt-caret { transition: none; }
}
/* Headings that run past a narrow band fade at its edge, so the row reads as one that scrolls. */
@media (max-width: 720px) {
  .mlm-kt[data-state='closed'] .mlm-kt-heads {
    mask-image: linear-gradient(to right, #000 80%, transparent);
  }
}
