/* ─── checkbox component (see checkbox.js) ─── */

.cb {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
}

.cb-input {
  position: absolute;
  opacity: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: inherit;
}

.cb-box {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1.5px solid transparent;
  background: transparent;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  pointer-events: none;
}

.cb-icon {
  grid-area: 1 / 1;
  width: 12px;
  height: 12px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.1s, transform 0.1s;
}

.cb-input:checked + .cb-box .cb-check,
.cb-input:indeterminate + .cb-box .cb-dash {
  opacity: 1;
  transform: scale(1);
}

/* ─── dark surface (popover, dark panels) ─── */

.cb--dark .cb-box {
  border-color: rgba(255, 255, 255, 0.82);
}

.cb--dark:hover:not(.is-disabled) .cb-box {
  border-color: #fff;
}

.cb--dark .cb-input:checked + .cb-box,
.cb--dark .cb-input:indeterminate + .cb-box {
  background: #fff;
  border-color: #fff;
}

.cb--dark .cb-check,
.cb--dark .cb-dash {
  color: #111;
}

.cb--dark .cb-input:focus-visible + .cb-box {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

/* ─── light surface (cards, forms, admin) ─── */

.cb--light .cb-box {
  border-color: rgba(17, 17, 17, 0.32);
}

.cb--light:hover:not(.is-disabled) .cb-box {
  border-color: rgba(17, 17, 17, 0.55);
}

.cb--light .cb-input:checked + .cb-box,
.cb--light .cb-input:indeterminate + .cb-box {
  background: #111;
  border-color: #111;
}

.cb--light .cb-check,
.cb--light .cb-dash {
  color: #fff;
}

.cb--light .cb-input:focus-visible + .cb-box {
  outline: 2px solid rgba(17, 17, 17, 0.35);
  outline-offset: 2px;
}

/* ─── shared states ─── */

.cb.is-disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.cb-text {
  font-size: inherit;
  line-height: 1.3;
  color: inherit;
}
