/* Composants : boutons, champs, panneaux tracés, tuiles, puces, bascules, fenêtres, toasts, Markdown… */

@property --fl {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(255, 255, 255, 0.13);
}

/* --- Touches de clavier --- */
.kbd {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 7px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  font-size: var(--t-11);
  font-weight: 560;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  white-space: nowrap;
}

/* --- Boutons --- */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  color: var(--fg);
  font-size: var(--t-13);
  font-weight: 580;
  font-stretch: 106%;
  white-space: nowrap;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.15s var(--ease), box-shadow 0.3s var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--inv-bg);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.5s var(--ease-out);
}
.btn:hover {
  color: var(--inv-fg);
  border-color: var(--inv-bg);
}
.btn:hover::before {
  transform: scaleX(1);
  transform-origin: left center;
}
.btn:active {
  transform: scale(0.97);
}
.btn.primary {
  background: var(--inv-bg);
  color: var(--inv-fg);
  border-color: var(--inv-bg);
}
.btn.primary::before {
  background: linear-gradient(100deg, transparent 20%, rgba(127, 127, 127, 0.28) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease-out);
}
.btn.primary:hover {
  box-shadow: 0 0 0 4px var(--haze-3);
}
.btn.primary:hover::before {
  transform: translateX(120%);
}
.btn.quiet {
  border-color: transparent;
  color: var(--fg-2);
}
.btn.quiet::before {
  background: var(--haze-2);
}
.btn.quiet:hover {
  color: var(--fg);
  border-color: transparent;
}
.btn.icon {
  width: 38px;
  padding: 0;
}
.btn.sm {
  height: 30px;
  padding: 0 13px;
  font-size: var(--t-12);
  gap: 6px;
}
.btn.sm.icon {
  width: 30px;
  padding: 0;
}
.btn.lg {
  height: 48px;
  padding: 0 26px;
  font-size: var(--t-14);
  gap: 10px;
}
.btn[disabled],
.btn.disabled {
  opacity: 0.38;
  pointer-events: none;
}
.btn.busy {
  pointer-events: none;
}
.btn.busy > .ico {
  display: none;
}
.btn.busy::after {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  animation: zk-spin 0.7s linear infinite;
  order: -1;
}
.btn.danger:hover {
  color: var(--inv-fg);
}
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* --- Champs --- */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.field-hint {
  font-size: var(--t-12);
  color: var(--fg-3);
}
.input,
.textarea,
.select {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-input);
  background: transparent;
  color: var(--fg);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s;
}
.input::placeholder,
.textarea::placeholder {
  color: var(--fg-4);
}
.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--line-3);
}
.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--fg);
  box-shadow: 0 0 0 4px var(--haze-2);
}
.textarea {
  height: auto;
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.55;
}
.textarea.code,
.input.code {
  font-family: var(--mono);
  font-size: var(--t-13);
  font-stretch: 100%;
}
.input.lg {
  height: 48px;
  font-size: var(--t-16);
  padding: 0 18px;
}
.select-wrap {
  position: relative;
}
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  cursor: pointer;
}
.select option {
  background: var(--bg);
  color: var(--fg);
}
.select-wrap .ico {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--fg-3);
}
.input-group {
  display: flex;
  gap: 8px;
}

/* Case à cocher dessinée */
.check {
  position: relative;
  width: 20px;
  height: 20px;
  flex: none;
  border: 1.5px solid var(--line-3);
  border-radius: 6px;
  display: grid;
  place-items: center;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--spring);
}
.check svg {
  width: 13px;
  height: 13px;
  stroke: var(--inv-fg);
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.check svg path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.35s var(--ease-out) 0.05s;
}
.check.on {
  background: var(--inv-bg);
  border-color: var(--inv-bg);
}
.check.on svg path {
  stroke-dashoffset: 0;
}
.check:active {
  transform: scale(0.88);
}

/* Bascule */
.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  flex: none;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-3);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fg-2);
  transition: transform 0.5s var(--spring), background 0.3s var(--ease), width 0.2s var(--ease);
}
.toggle:active::after {
  width: 20px;
}
.toggle[aria-checked="true"] {
  background: var(--inv-bg);
  border-color: var(--inv-bg);
}
.toggle[aria-checked="true"]::after {
  transform: translateX(18px);
  background: var(--inv-fg);
}
.toggle[aria-checked="true"]:active::after {
  transform: translateX(14px);
}

/* Curseur */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(var(--fg), var(--fg)) 0 / var(--p, 50%) 100% no-repeat, var(--line-2);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 0 4px var(--bg);
  transition: transform 0.2s var(--spring);
}
.range:active::-webkit-slider-thumb {
  transform: scale(1.25);
}
.range::-moz-range-track {
  height: 2px;
  background: var(--line-2);
}
.range::-moz-range-progress {
  height: 2px;
  background: var(--fg);
}
.range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
}

/* Contrôle segmenté */
.seg {
  position: relative;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  isolation: isolate;
}
.seg button {
  position: relative;
  z-index: 1;
  height: 30px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: var(--t-12);
  font-weight: 580;
  color: var(--fg-2);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.35s var(--ease);
}
.seg button:hover {
  color: var(--fg);
}
.seg button.on {
  color: var(--inv-fg);
}
.seg-ind {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 0;
  border-radius: var(--r-pill);
  background: var(--inv-bg);
  transition: transform 0.5s var(--spring), width 0.45s var(--ease-out);
}

/* Onglets */
.tabs {
  position: relative;
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 14px;
  font-size: var(--t-14);
  font-weight: 560;
  font-stretch: 106%;
  color: var(--fg-3);
  white-space: nowrap;
  transition: color 0.3s var(--ease);
}
.tabs button:hover {
  color: var(--fg-2);
}
.tabs button.on {
  color: var(--fg);
}
.tabs-ind {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--fg);
  transition: transform 0.5s var(--spring), width 0.45s var(--ease-out);
}

/* Puces */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  font-size: var(--t-12);
  font-weight: 560;
  color: var(--fg-2);
  white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--spring);
}
button.chip:hover {
  border-color: var(--line-3);
  color: var(--fg);
}
button.chip:active {
  transform: scale(0.95);
}
.chip.on {
  background: var(--inv-bg);
  color: var(--inv-fg);
  border-color: var(--inv-bg);
}
.chip.big {
  height: 40px;
  padding: 0 18px;
  font-size: var(--t-14);
  font-weight: 620;
  font-stretch: 110%;
}
.chip .tiny {
  opacity: 0.6;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  font-size: var(--t-11);
  font-weight: 600;
  color: var(--fg-2);
  white-space: nowrap;
}
.badge.inv {
  background: var(--inv-bg);
  color: var(--inv-fg);
  border-color: var(--inv-bg);
}
.badge.dashed {
  border-style: dashed;
}

/* --- Panneau tracé (le traceur dessine son cadre) --- */
.frame {
  --fl: var(--line);
  position: relative;
  padding: 22px;
  border-radius: var(--r-panel);
  min-width: 0;
  transition: --fl 0.35s var(--ease);
}
.frame::before,
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}
.frame::before {
  background: linear-gradient(var(--fl), var(--fl)) left top / 100% 1px no-repeat, linear-gradient(var(--fl), var(--fl)) right bottom / 100% 1px no-repeat;
  animation: zk-draw-h 0.9s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 55ms + var(--d, 0ms));
}
.frame::after {
  background: linear-gradient(var(--fl), var(--fl)) left bottom / 1px 100% no-repeat, linear-gradient(var(--fl), var(--fl)) right top / 1px 100% no-repeat;
  animation: zk-draw-v 0.9s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 55ms + var(--d, 0ms) + 120ms);
}
.frame.hover:hover,
.frame.lit {
  --fl: var(--line-3);
}
.frame.flat {
  padding: 0;
}
.frame.tight {
  padding: 16px;
}
.frame.roomy {
  padding: 32px;
}
.frame-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.frame-title {
  font-size: var(--t-14);
  font-weight: 620;
  font-stretch: 108%;
  display: flex;
  align-items: center;
  gap: 9px;
}
.frame-title .ico {
  color: var(--fg-2);
}

/* --- Tuile d'action (interactive) --- */
.tile {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  color: var(--fg);
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.25s var(--ease);
}
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--inv-bg);
  clip-path: circle(0% at var(--mx, 50%) var(--my, 100%));
  transition: clip-path 0.6s var(--ease-out);
}
.tile:hover {
  color: var(--inv-fg);
  border-color: var(--inv-bg);
}
.tile:hover::before {
  clip-path: circle(150% at var(--mx, 50%) var(--my, 100%));
}
.tile:active {
  transform: scale(0.985);
}
.tile .tile-ico {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid currentColor;
  opacity: 0.9;
}
.tile .tile-title {
  font-size: var(--t-16);
  font-weight: 620;
  font-stretch: 110%;
  letter-spacing: -0.01em;
}
.tile .tile-desc {
  font-size: var(--t-12);
  opacity: 0.66;
  line-height: 1.45;
}
.tile .tile-arrow {
  position: absolute;
  right: 18px;
  top: 18px;
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity 0.3s var(--ease), transform 0.45s var(--ease-out);
}
.tile:hover .tile-arrow {
  opacity: 1;
  transform: none;
}

/* --- Feuilles (fenêtres modales) --- */
.sheet {
  background: var(--bg);
  border-radius: var(--r-sheet);
  box-shadow: var(--shadow);
}
.modal {
  position: fixed;
  z-index: 131;
  top: 50%;
  left: 50%;
  width: min(520px, calc(100vw - 48px));
  max-height: calc(100vh - 80px);
  overflow: auto;
  transform: translate(-50%, -50%);
  padding: 28px;
  animation: zk-pop 0.35s var(--ease-out) both;
}
.modal.wide {
  width: min(860px, calc(100vw - 48px));
}
.modal-title {
  font-size: var(--t-21);
  font-weight: 640;
  font-stretch: 114%;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.modal-body {
  color: var(--fg-2);
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}
.scrim.modal-scrim {
  z-index: 130;
}

/* --- Toasts --- */
.toasts {
  position: fixed;
  z-index: 150;
  right: 22px;
  bottom: calc(var(--foot-h) + 18px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.toast {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  padding: 13px 18px 13px 14px;
  border-radius: 14px;
  background: var(--inv-bg);
  color: var(--inv-fg);
  font-size: var(--t-13);
  font-weight: 520;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  animation: zk-toast-in 0.45s var(--spring) both;
}
.toast.out {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast .toast-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--inv-fg);
  opacity: 0.35;
  transform-origin: left;
  animation: zk-shrink var(--dur, 3.6s) linear both;
}
.toast button {
  color: inherit;
  font-weight: 640;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Zone de dépôt --- */
.dropzone {
  --c: var(--line-2);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 220px;
  padding: 36px;
  text-align: center;
  background: linear-gradient(90deg, var(--c) 55%, transparent 0) top left / 18px 1px repeat-x, linear-gradient(90deg, var(--c) 55%, transparent 0) bottom left / 18px 1px repeat-x,
    linear-gradient(0deg, var(--c) 55%, transparent 0) top left / 1px 18px repeat-y, linear-gradient(0deg, var(--c) 55%, transparent 0) top right / 1px 18px repeat-y;
  transition: background-color 0.3s var(--ease);
  cursor: pointer;
}
.dropzone:hover {
  --c: var(--line-3);
}
.dropzone.over {
  --c: var(--fg);
  background-color: var(--haze);
  animation: zk-march 0.7s linear infinite;
}
.dropzone .dz-ico {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  transition: transform 0.5s var(--spring), background 0.3s, color 0.3s;
}
.dropzone.over .dz-ico,
.dropzone:hover .dz-ico {
  transform: translateY(-4px);
}
.dropzone.over .dz-ico {
  background: var(--inv-bg);
  color: var(--inv-fg);
}
.dropzone .dz-title {
  font-size: var(--t-18);
  font-weight: 620;
  font-stretch: 112%;
}
.dropzone .dz-sub {
  font-size: var(--t-13);
  color: var(--fg-3);
}

/* --- Progression --- */
.progress {
  position: relative;
  height: 2px;
  background: var(--line);
  overflow: hidden;
}
.progress i {
  position: absolute;
  inset: 0;
  background: var(--fg);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  transition: transform 0.4s var(--ease-out);
}
.progress.indeterminate i {
  animation: zk-indeterminate 1.3s var(--ease-io) infinite;
}
.meter {
  height: 4px;
  background: var(--line);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}
.meter i {
  position: absolute;
  inset: 0;
  background: var(--fg);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  transition: transform 1s var(--ease-out);
}
.spin {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  animation: zk-spin 0.75s linear infinite;
}
.skeleton {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--haze) 25%, var(--haze-3) 50%, var(--haze) 75%) 0 0 / 200% 100%;
  animation: zk-shimmer 1.6s linear infinite;
}

/* --- Listes et tableaux --- */
.list {
  display: flex;
  flex-direction: column;
}
.li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.li:last-child {
  border-bottom: 0;
}
.li.hover {
  transition: background 0.2s;
  border-radius: 8px;
  padding-left: 10px;
  padding-right: 10px;
}
.li.hover:hover {
  background: var(--haze);
}
.li .li-main {
  flex: 1;
  min-width: 0;
}
.li .li-title {
  font-weight: 560;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.li .li-sub {
  font-size: var(--t-12);
  color: var(--fg-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.li .li-actions {
  display: flex;
  gap: 4px;
  opacity: 0.0;
  transition: opacity 0.2s;
}
.li:hover .li-actions,
.li:focus-within .li-actions {
  opacity: 1;
}
.li .li-val {
  flex: none;
  min-width: 64px;
  text-align: right;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-13);
}
.table th {
  text-align: left;
  font-size: var(--t-11);
  font-weight: 600;
  color: var(--fg-3);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:hover td {
  background: var(--haze);
}
.table td.num,
.table th.num {
  text-align: right;
}

/* --- États --- */
.st {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--t-12);
  font-weight: 600;
  white-space: nowrap;
}
.st svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--fg-2);
}
.empty > .ico {
  width: 34px;
  height: 34px;
  stroke-width: 1.2;
  color: var(--fg-3);
}
.empty-title {
  font-size: var(--t-16);
  font-weight: 620;
  color: var(--fg);
  font-stretch: 108%;
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  font-size: var(--t-13);
  color: var(--fg-2);
}
.notice .ico {
  margin-top: 1px;
  color: var(--fg);
}
.notice.inv {
  background: var(--inv-bg);
  color: var(--inv-fg);
  border-color: var(--inv-bg);
}
.notice.inv .ico {
  color: var(--inv-fg);
}

/* Infobulle */
.tip {
  position: fixed;
  z-index: 160;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--inv-bg);
  color: var(--inv-fg);
  font-size: var(--t-12);
  font-weight: 560;
  pointer-events: none;
  white-space: nowrap;
  animation: zk-pop 0.18s var(--ease-out) both;
}

/* Menu contextuel */
.menu {
  position: fixed;
  z-index: 140;
  min-width: 200px;
  padding: 6px;
  animation: zk-drop 0.2s var(--ease-out) both;
}
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: var(--t-13);
  color: var(--fg-2);
  text-align: left;
}
.menu button:hover {
  background: var(--inv-bg);
  color: var(--inv-fg);
}

/* --- Markdown --- */
.md {
  font-size: var(--t-14);
  line-height: 1.68;
  color: var(--fg);
  overflow-wrap: anywhere;
}
.md > * + * {
  margin-top: 0.85em;
}
.md h1,
.md h2,
.md h3,
.md h4 {
  font-stretch: 110%;
  letter-spacing: -0.012em;
  line-height: 1.25;
  font-weight: 640;
}
.md h1 {
  font-size: 1.6em;
}
.md h2 {
  font-size: 1.28em;
  margin-top: 1.5em;
}
.md h3 {
  font-size: 1.08em;
  margin-top: 1.3em;
}
.md h4 {
  font-size: 1em;
}
.md > :first-child {
  margin-top: 0;
}
.md ul,
.md ol {
  padding-left: 1.3em;
}
.md ul {
  list-style: none;
}
.md ul > li {
  position: relative;
}
.md ul > li::before {
  content: "";
  position: absolute;
  left: -1.05em;
  top: 0.78em;
  width: 0.42em;
  height: 1px;
  background: var(--fg-2);
}
.md ol {
  list-style: decimal;
}
.md ol > li::marker {
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}
.md li + li {
  margin-top: 0.3em;
}
.md strong {
  font-weight: 650;
}
.md em {
  font-style: italic;
}
.md code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: var(--haze-2);
}
.md pre {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  font-size: var(--t-13);
  line-height: 1.55;
}
.md pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}
.md pre .copy-code {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}
.md pre:hover .copy-code {
  opacity: 1;
}
.md blockquote {
  margin: 0;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--fg);
  color: var(--fg-2);
}
.md table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94em;
  display: block;
  overflow-x: auto;
}
.md th,
.md td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.md th {
  font-weight: 620;
  border-bottom-color: var(--line-2);
}
.md hr {
  margin: 1.6em 0;
}
.md a {
  word-break: break-word;
}
.md .cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin: 0 2px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
  vertical-align: 2px;
}
.caret {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--fg);
  animation: zk-blink 1s steps(1) infinite;
}

/* Grilles */
.grid {
  display: grid;
  gap: 16px;
}
.grid.c2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.c3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid.c4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .grid.c4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.c3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .grid.c2,
  .grid.c3,
  .grid.c4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 22px;
  font-size: var(--t-13);
}
.kv dt {
  color: var(--fg-3);
}
.kv dd {
  margin: 0;
  font-weight: 540;
  min-width: 0;
  overflow-wrap: anywhere;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 28px 0;
}
.big-num {
  font-size: var(--t-36);
  font-weight: 660;
  font-stretch: 116%;
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
